Packagecom.aispeech.recorder
Classpublic class Recorder4RTMPService
InheritanceRecorder4RTMPService Inheritance RecorderBase Inheritance flash.events.EventDispatcher
Implements IRecorder

recorder used with a RTMP connection
  • 1. replay local audio have distortion when we use speex , because speex default is 16KHZ
  • 2. if fmslist have error url , audiorecorder will throw a exception , we shounld deal this case


  • Public Properties
     PropertyDefined By
     InheriteddingPlayEnabled : Boolean
    RecorderBase
     InheriteddingVolume : Number
    Set ding volume
    RecorderBase
     InheritedreplayVolume : Number
    get replay volume
    RecorderBase
     Inheritedstate : String
    [read-only]
    RecorderBase
    Protected Properties
     PropertyDefined By
     Inherited_dingIndex : uint
    RecorderBase
     Inherited_localWave : LocalWave
    RecorderBase
     Inherited_recorderLog : RecorderLog
    RecorderBase
     Inherited_recordId : String
    RecorderBase
     Inherited_recordingTimerId : int
    RecorderBase
     Inherited_recordLength : int
    RecorderBase
     Inherited_requestId : String
    RecorderBase
     Inherited_state : String = recorder.not.ready
    RecorderBase
     Inherited_stopType : String
    RecorderBase
    Public Methods
     MethodDefined By
      
    Recorder4RTMPService(singleMade:SingleMade)
    Singleton constructor
    Recorder4RTMPService
      
    dispose():void
    Stop record and stop replay if applicable.
    Recorder4RTMPService
      
    [static]
    Recorder4RTMPService
      
    init(connection:IConnection, coreRequester:ICoreRequester):void
    Init a recorder Recorder State switches to RecorderState.IDLE
    Recorder4RTMPService
     Inherited
    playDing():void
    RecorderBase
      
    startRecord(recordLength:int = 2000):String
    Start recording.
    Recorder4RTMPService
     Inherited
    startReplay(recordId:String):String
    start replay using local wave
    RecorderBase
      
    stopRecord(stopType:String):String
    Stop recording
    Recorder4RTMPService
     Inherited
    stopReplay():String
    Stop replaying
    RecorderBase
    Protected Methods
     MethodDefined By
      
    __stopRecord():String
    Stop record Dispatch RecorderEvent.RECORD_STOPPED while returns StatusCode.FUNCTION_EXECUTE_SUCCESSFUL
    Recorder4RTMPService
     Inherited
    genRecordId():String
    Generate record ID, using UUID
    RecorderBase
     Inherited
    getWaveLength(wave:ByteArray, sampleRate:int):Number
    get wave length (ms)
    RecorderBase
      
    netStatusEventHandler(event:NetStatusEvent):void
    net status event handler Dispatch RecorderEvent.RECORD_STARTED (event data: {recordId:}) if event.info.code is NetStream.Publish.Start
    Recorder4RTMPService
     Inherited
    replay stop event handler
    RecorderBase
    Public Constants
     ConstantDefined By
     InheritedRECORD_LENGTH : int = 2000
    [static]
    RecorderBase
     InheritedSTOP_TYPE_AUTO : String = stop.auto
    [static]
    RecorderBase
     InheritedSTOP_TYPE_MANUAL : String = stop.manually
    [static]
    RecorderBase
    Constructor Detail
    Recorder4RTMPService()Constructor
    public function Recorder4RTMPService(singleMade:SingleMade)

    Singleton constructor

    Parameters
    singleMade:SingleMade
    Method Detail
    __stopRecord()method
    protected function __stopRecord():String

    Stop record Dispatch RecorderEvent.RECORD_STOPPED while returns StatusCode.FUNCTION_EXECUTE_SUCCESSFUL

    Returns
    String — status code
                 StatusCode.FUNCTION_EXECUTE_SUCCESSFUL
                 StatusCode.EXCEPTION_RECORDER_STATE_ERROR
             
    dispose()method 
    public function dispose():void

    Stop record and stop replay if applicable. Clear connection's stream instance. Recorder state switches to RecorderState.NOTREADY

    getInstance()method 
    public static function getInstance():Recorder4RTMPService

    Returns
    Recorder4RTMPService
    init()method 
    public function init(connection:IConnection, coreRequester:ICoreRequester):void

    Init a recorder Recorder State switches to RecorderState.IDLE

    Parameters

    connection:IConnection
     
    coreRequester:ICoreRequester

    netStatusEventHandler()method 
    protected function netStatusEventHandler(event:NetStatusEvent):void

    net status event handler

    Dispatch RecorderEvent.RECORD_STARTED (event data: {recordId:}) if event.info.code is NetStream.Publish.Start

    Parameters

    event:NetStatusEvent — NetStatusEvent

    startRecord()method 
    public function startRecord(recordLength:int = 2000):String

    Start recording.

    Recorder state switches to RecorderState.WAITINGTOSTARTRECORDING

    Dispatch RecorderEvent.RECORDID_GOT (event data: {recordId:}) while returns StatusCode.FUNCTION_EXECUTE_SUCCESSFUL

    Parameters

    recordLength:int (default = 2000) — default 2000 (ms)

    Returns
    String — status code
                 StatusCode.FUNCTION_EXECUTE_SUCCESSFUL
                 StatusCode.EXCEPTION_RECORDER_STATE_ERROR
                 StatusCode.EXCEPTION_MIC_NOT_AVAILABLE
                 StatusCode.MIC_MUTED
                 StatusCode.EXCEPTION_CONNECTION_NOT_READY
                 StatusCode.EXCEPTION_LOCALWAVE_NOT_READY
             
    stopRecord()method 
    public function stopRecord(stopType:String):String

    Stop recording

    Parameters

    stopType:String — RecorderBase.STOP_TYPE_MANUAL or RecorderBase.STOP_TYPE_AUTO

    Returns
    String — status code

    See also