Code example for AudioRecord

Methods: getRecordingStategetStatestop

0
                    + ".startRec(): Failed to initialise microphone."); 
        } 
    } 
 
    protected void stopRec() { 
        if ((_mic != null) && (_mic.getState() == AudioRecord.STATE_INITIALIZED)) {
            if (_mic.getRecordingState() != AudioRecord.RECORDSTATE_STOPPED) {
                _mic.stop();
            } 
            Log.debug(this.getClass().getSimpleName()
                    + ".stopRec(): mic stopped"); 
        } 
 
        if (_me != null) {
            Thread tmic = _me;
            _me = null;
            try { 
                tmic.join(1000);
                Log.debug( 
                        this.getClass().getSimpleName()
                        + ".stopRec(): micThread stoppped");