PhoneGap Android plugin for recording higher quality sound?

The Media PhoneGap API provides a cross-platform sound recording engine that runs on android, but the sound quality is completely horrible - a sampling frequency of 8 kHz and possibly some high-loss codec. I understand from this SO question that with java code you can get better audio.

Does anyone know a PhoneGap plugin for Android that allows you to record better audio recordings?

+7
source share
2 answers

Unfortunately, you have to write your own plugin.

Current plugins are listed here: https://github.com/phonegap/phonegap-plugins/tree/master/Android

There is an older audio recording for iOS. Maybe you can look there:

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

Creating a plugin is not so important. Here is the code for the actual recording:

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

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

+2
source

For everyone we were interested in, we refused to support anything other than Android 2.3, and ourselves changed the Cordova native code.

If you use Cordova 3+, I forked the project with code changes here

For previous releases, just change AudioPlayer.java (this is from Cordoba 2.9)

// support only 2.3.3+ to be able to record AAC with 44100 audio sampling this.recorder.setAudioSamplingRate(44100); this.recorder.setAudioEncodingBitRate(96000); this.recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); this.recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); //this.recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);// THREE_GPP); //this.recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);// //AMR_NB); 
+8
source

All Articles