Code example for AudioRecord

Methods: getRecordingStategetStatestartRecording

2
    protected int getOutboundTimestamp() { 
        return (int) _countFrames * _audio.getFrameInterval();
    } 
 
    protected void startRec() { 
        if (_mic != null && _mic.getState() == AudioRecord.STATE_INITIALIZED) {
            Log.debug( 
                    this.getClass().getSimpleName()
                    + ".startRec(): starting mic"); 
            _mic.startRecording();
            resetTimestampRecStart(); 
            _countFrames = 0;
 
            Log.debug( 
                    this.getClass().getSimpleName() + ".startRec(): state="
                    + _mic.getState() + ", recordingState="
                    + _mic.getRecordingState());
 
            if (_me == null) {
                _me = new Thread(this, "mic");
                //_me.setPriority(Thread.NORM_PRIORITY); 
                _me.start();