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

sound wave from recording voice #52

Open
sultan-arshi opened this issue Mar 15, 2020 · 2 comments
Open

sound wave from recording voice #52

sultan-arshi opened this issue Mar 15, 2020 · 2 comments

Comments

@sultan-arshi
Copy link

i am recording a voice and want to show sound wave for it but i am getting audioRecorder.averagePower(forChannel: 0) but i am getting value less then zero and greater then 1 and you library need values from 0 to 1
how can i convert this value ?

@bastienFalcou
Copy link
Owner

Hi @sultan-arshi!

Do you know the minimum and maximum values for the number you are getting while recording a voice? If so, with a fairly simple calculation you can bring this value back in a range between 0 and 1.

If you don't know what minimum and maximum are, I would just do some experimentation to find arbitrary values and use that as constants in your codebase. It should be good enough to draw meaningful waves :)

@sultan-arshi
Copy link
Author

according to doc A return value of 0 dB indicates full scale, or maximum power; a return value of –160 dB indicates minimum power (that is, near silence).
means max = 0 db
and min = -160 db
i tried a lot to convert them

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

2 participants