framework/src/org/apache/cordova/AudioPlayer.java
/**
     * Start recording the specified file.
     * 
     * @param file              The name of the file
     */
Start recording the specified file.

@param file              The name of the file
Start recording the specified file . @param file The name of the file
public void startRecording(String file) {
        if (this.mPlayer != null) {
            Log.d(LOG_TAG, "AudioPlayer Error: Can't record in play mode.");
            this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
        }
        else if (this.recorder == null) {
            this.audioFile = file;
            this.recorder = new MediaRecorder();
            this.recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
            this.recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); 
            this.recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); 
            this.recorder.setOutputFile(this.tempFile);
            try {
                this.recorder.prepare();
                this.recorder.start();
                this.setState(MEDIA_RUNNING);
                return;
            } catch (IllegalStateException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
        }
        else {
            Log.d(LOG_TAG, "AudioPlayer Error: Already recording.");
            this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
        }
    }
public void startRecording ( String file ) { if ( this . mPlayer != null ) { Log . d ( LOG_TAG , "AudioPlayer Error: Can't record in play mode." ) ; this . handler . sendJavascript ( "cordova.require('cordova/plugin/Media').onStatus('" + this . id + "', " + MEDIA_ERROR + ", { \"code\":" + MEDIA_ERR_ABORTED + "});" ) ; } else if ( this . recorder == null ) { this . audioFile = file ; this . recorder = new MediaRecorder ( ) ; this . recorder . setAudioSource ( MediaRecorder . AudioSource . MIC ) ; this . recorder . setOutputFormat ( MediaRecorder . OutputFormat . DEFAULT ) ; this . recorder . setAudioEncoder ( MediaRecorder . AudioEncoder . DEFAULT ) ; this . recorder . setOutputFile ( this . tempFile ) ; try { this . recorder . prepare ( ) ; this . recorder . start ( ) ; this . setState ( MEDIA_RUNNING ) ; return ; } catch ( IllegalStateException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } this . handler . sendJavascript ( "cordova.require('cordova/plugin/Media').onStatus('" + this . id + "', " + MEDIA_ERROR + ", { \"code\":" + MEDIA_ERR_ABORTED + "});" ) ; } else { Log . d ( LOG_TAG , "AudioPlayer Error: Already recording." ) ; this . handler . sendJavascript ( "cordova.require('cordova/plugin/Media').onStatus('" + this . id + "', " + MEDIA_ERROR + ", { \"code\":" + MEDIA_ERR_ABORTED + "});" ) ; } }
Start recording the specified file.
Start recording the specified file .
// Make sure we're not already recording // THREE_GPP); //AMR_NB);