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

Audio Level Metering #39

Open
cortensinger opened this issue Jul 29, 2019 · 1 comment
Open

Audio Level Metering #39

cortensinger opened this issue Jul 29, 2019 · 1 comment

Comments

@cortensinger
Copy link

cortensinger commented Jul 29, 2019

I want to access the input volume level coming in through the microphone. For the end result, I want to display a live 'Volume Meter' for user feedback while recording.

Is there any possible way to access the microphone's input volume when recording audio using this plugin?

EDIT: I see this plugin implements recording via an InputAudioQueue, and not the AVAudioRecorder. But these AudioQueues have the CurrentLevelMeter property that could be used to do what I want. Is there a way that I can access the current AudioQueue from my DependencyService thats responsible for all this?

EDIT 2: I was able to fix this in my code, but I had to edit your source code, so I dont know if I should close this issue or not. To fix it, I simply cloned the project to create a local assembly and then made a Public Static Float volumeLevel variable in the AudioRecordingService.cs file and then updated the value of volumeLevel with the result of Calculate_Levels() every time its called in the AudioStream_OnBroadcast() event handler. Then from my personal app, I referenced the local DLL and was able to simply access the volumeLevel variable whenever I wanted to update the GUI to show the changing volume level. This was it still acts as a cross-platform solution and it doesnt add any more heavy lifting than you have already done in your code. Works great!

@NateRickard
Copy link
Owner

I'd love to see a PR that added this functionality into the library...

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

No branches or pull requests

2 participants