Cellules / cordova-audiofrequency

This plugin captures the device's audio input stream and analyses it to return the maximum frequency.
MIT License
5 stars 6 forks source link

Plugin not found #2

Open luc0 opened 9 years ago

luc0 commented 9 years ago

I want to give it a try, but I can't install it in console by:

cordova plugin add com.cellules.cordova.audiofrequency

it returns 404 not found. I have cordova 4.2.0

luc0 commented 9 years ago

I get the answer, it's done via:

cordova plugin add https://github.com/Cellules/cordova-audiofrequency.git

sorry, I am a little newbie in this area! Another question, is there any way to get the amplitud of the wave?, because I want to draw it in real-time. Thanks!

moust commented 9 years ago

This plugin is not build for that use but you can adapt it easily to do what you want.

If you look at the native code of each platform, it process a Fast Fourier Transform (FFT) operation which return the signal in a frequency domaine (array of amplitude for each frequency values). Then the plugin simply returns the frequency value with the highest amplitude value.

In your case, if you want to draw the wave, you need to return the whole array of values.

Depending of what you need, time domaine or frequency domaine, you don't need the FFT transformation and just have to return the microphone measurements (time domaine).

luc0 commented 9 years ago

Thanks. I am not good with Java, but I'll give it a try to change it