PhoneGap Android 插件可实现更高质量的录音?
PhoneGap 媒体 API 提供一种以交叉方式录制音频的机制平台方式适用于 Android,但音频质量非常糟糕——8 kHz 采样率,也许还有一些高损耗编解码器。我从这个问题中了解到,使用java代码可以获得更高质量的音频录制。
有人知道 Android 上的 PhoneGap 插件可以实现更高质量的录音吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于任何感兴趣的人,我们所做的就是放弃对低于 Android 2.3 的任何内容的支持,并自行修改 Cordova 本机代码。
此处 分叉了代码更改的项目
如果您使用 Cordova 3+,我在 发布后,只需修改 AudioPlayer.java (这是来自 Cordova 2.9 的)
For anyone interested, what we did was dropping support for anything less than Android 2.3 and modify the Cordova native code ourselves.
If you are using Cordova 3+, I forked the project with the code changes here
For previous releases, just modify AudioPlayer.java (this is from Cordova 2.9)
不幸的是,您将不得不编写自己的插件。
这里是当前插件的列表: https://github.com/phonegap/phonegap- plugins/tree/master/Android
对于 IOS,有一个较旧的音频记录。也许你可以看看那里:
https://github.com/phonegap /phonegap-plugins/tree/master/iOS/AudioRecord
不过,创建插件并不是什么大问题。这里有一些实际录制的代码:
http://www.androiddevblog.net /android/android-audio-recording-part-2
http://developer.android.com/reference/android/media/AudioRecord.html
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