I've been learning Cordova, now I am developing an app to record voice and I'd like to get the volume/Db/Amplitude of the sound being recorded. I know that there's no oficial plugin by Cordova about this, so I searched and tested some plugins out there:
Wavesurfer.js:
It's easy and have a lot of features, but in android is not working, i don't know if the problem is webview or what (I have Android 4.1.2) here are the details of my problem with this plugin: https://github.com/katspaugh/wavesurfer.js/issues/341
MicVolume.js:
https://github.com/shukriadams/micVolume I try this without success, I don't know exactly what's the problem but I think in this case it's in the cordova.exec
I can't find more plugins. Is there something else I can do or use, or maybe I am doing something wrong? I think it's strange that I can´t find easy this kind of plugin, so maybe the solution it's starting to learn java from scratch? >:(
Thanks in advance.
You should use Crosswalk so that you can access the Web Audio API without a Cordova plugin. From there you could use something like this example:
http://tyleregeto.com/article/extracting-audio-data-with-the-web-audio-api
As of the current Crosswalk version, the Web Audio API is fully supported, and since you are using Cordova, you won't have any Cross-Origin issues to worry about (e.g. you will be on 'localhost' so there won't be any HTTPS problems).
I have built a Metronome in Angular that I used in a recent Ionic app with Crosswalk, and it works perfectly (even on a pretty bad XGODY device I used for testing). See the Gist below: