Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set sampling rate? #18

Open
nwatab opened this issue Oct 17, 2020 · 6 comments
Open

Is it possible to set sampling rate? #18

nwatab opened this issue Oct 17, 2020 · 6 comments

Comments

@nwatab
Copy link

nwatab commented Oct 17, 2020

Thank you for nice library. Is it possible to set or change sampling rate? It seems that the sampling rate is fixed to 22050Hz.

@Jonjoe
Copy link
Contributor

Jonjoe commented Jan 22, 2021

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);

@ncstc1
Copy link

ncstc1 commented Dec 6, 2022

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.

@punarinta
Copy link
Owner

@ncstc1 I've added sampling rate control in v1.2.0. Here's a usage example.

@alessioemireni
Copy link

on iOS doesn't compile because the parameter is sampleRate and not samplingRate 823eca0#diff-d62cb5adc173b12956b9aa426c235fe753fdc142830696461d56287931b454d6R75

@alessioemireni
Copy link

@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.
#32
Let me know. Thx

@alaingoldman
Copy link

@alessioemireni this PR helped me a lot thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants