0

I'm recording audio on Android. I'm using this module: https://github.com/yagitoshiro/TiAudioRecorder

With .3gp extension I can record and replay the audio perfectly, but I need to record this audio with .wav or .mp3. With this extension I can't replay the sound, the app can't open the audio.

I saw at the module this line:

this.recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);

and searching on Android docs I found that ouput format only can be 3gp or mp4. wav is not available?

http://developer.android.com/reference/android/media/MediaRecorder.OutputFormat.html

etienne
  • 3,146
  • 1
  • 24
  • 45
amurcia
  • 801
  • 10
  • 26

1 Answers1

1

You can not obtain on the fly mp3 encoding from MediaRecorder. Check also the accepted answer from this question.

You can however use third party library for post processing like Gstreamer

Community
  • 1
  • 1
Radu Ionescu
  • 3,462
  • 5
  • 24
  • 43
  • 1
    WAV you can obtain by raw (pcm) data and a specific header (bitrate,channels). For this you should use `AudioRecorder`. Here is an [example](http://www.edumobile.org/android/audio-recording-in-wav-format-in-android-programming/). MediaRecorder can only give you at best a variable rate format (AMR-NB) – Radu Ionescu Feb 16 '16 at 11:24