Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Audio Capture In android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 460
    Comment on it

    Audio Capture In android

    To record audio there are so many ways. But Here I write audio recording method using MediaRecorder class.

    To use MediaRecorder class ,we must create an instance of MediaRecorder class.

    Syntax :

    MediaRecorder audioRecorder = new MediaRecorder();
    

    Now we need to set the output , source, encoding format and output file.

    Syntax :

    audioRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    audioRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    audioRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
    audioRecorder.setOutputFile(outputFile);

    after giving essentially information like source, format and output file, we need to call the method to done the task.

    audioRecorder.prepare();
    audioRecorder.start();

    Whenerver want to stop the recorder we need to call

    myAudioRecorder.stop();
    myAudioRecorder.release();

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: