Open nwatab opened 4 years ago
Hey bud, I know this is late but I love it when engineers come back and explain how they solved things so heres your answer :)
I had the same issue. I started looking through the code and I found this https://github.com/punarinta/react-native-sound-level/blob/master/index.js#L13
It means you can pass a sample number into the start function like this vvv
RNSoundLevel.start(1000);
Hello there, the start argument will change the monitorInterval but not the audio sampling rate.
At this point I think the sampling rate is fixed and cannot be changed.
@ncstc1 I've added sampling rate control in v1.2.0. Here's a usage example.
on iOS doesn't compile because the parameter is sampleRate and not samplingRate https://github.com/punarinta/react-native-sound-level/commit/823eca0963cf007322f1e545ca740c1023def054#diff-d62cb5adc173b12956b9aa426c235fe753fdc142830696461d56287931b454d6R75
@punarinta I have opened a pull request to fix the compilation error and add the option to allow haptic/sound system during recording on iOS devices. https://github.com/punarinta/react-native-sound-level/pull/32 Let me know. Thx
@alessioemireni this PR helped me a lot thanks!
Thank you for nice library. Is it possible to set or change sampling rate? It seems that the sampling rate is fixed to 22050Hz.