Search code examples
androidaudiopluginscordovaaudio-recording

PhoneGap Android plugin for higher quality audio recording?


The PhoneGap media API provides a mechanism to record audio in a cross-platform way which works on android, but the audio quality is completely horrible -- 8 kHz sampling rate and perhaps some highly lossy codec as well. I understand from this SO question that with java code it's possible to get higher quality audio recording.

Anybody know of a PhoneGap plugin for Android that allows for higher quality audio recording?


Solution

  • You will have to write your own plugin unfortunately.

    Here a list of current plugins: https://github.com/phonegap/phonegap-plugins/tree/master/Android

    For IOS there is an older audio record one. Maybe you can have a look there:

    https://github.com/phonegap/phonegap-plugins/tree/master/iOS/AudioRecord

    Creating a plugin is not such a big deal though. Here some code for the actual recording:

    http://www.androiddevblog.net/android/android-audio-recording-part-2

    http://developer.android.com/reference/android/media/AudioRecord.html