I am looking for a way to read volume data in real-time from the microphone. Just some kind of general "loudness". The purpose is to make lips move when you talk into the microphone on an html5 canvas element...
I basically want this plugin but for microphone levels instead of the camera:
https://github.com/casoninabox/luminance-cordova-ios
Does anyone know of any existing libraries to do this or how I might go about creating a plugin for iOS? I'm guessing it would involve the AVAudioSession
?
There is a plugin, that measures volume data in decibels: https://github.com/akofman/cordova-plugin-dbmeter
Install plugin with:
cordova plugin add cordova-plugin-dbmeter
Make sure that you add these lines to your app config.xml as that plugin doesn't currently support Swift 3.
<preference name="UseLegacySwiftLanguageVersion" value="true" />
Use plugin like that:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
DBMeter.start(function(dB){
console.log(dB);
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With