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

Added in-memory audio stream and audio level event #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EverOddish
Copy link

I plan to implement an app using Plugin.AudioRecorder that will use a continuous stream of audio. I won't necessarily need to store the audio in files on disk, so I've added a MemoryStream option to Plugin.AudioRecorder. I have not changed the default behaviour of storing audio to a file, so the changes should not affect any existing users of Plugin.AudioRecorder.

I would also like my app to display a visual representation of the current audio level, so I've added an event that is invoked when the audio level is updated.

I would greatly appreciate if these changes could be added to the next release of Plugin.AudioRecorder. Thank you!

@Haarmees
Copy link

Haarmees commented Nov 3, 2020

@NateRickard is it possible to merge and release this PR? For security reasons, we can't store audio as a file on the device. It would be nice if we could use this (awesome) library.

@NateRickard
Copy link
Owner

Thanks for the ping on this. I'm definitely interested in getting it merged in, but I'll have to recreate my build environment to generate the NuGet - I no longer have VS 2017 and the VS plugin I was using to properly generate the package is no longer maintained/exists for 2019. I'll try to revisit this shortly, stay tuned.

@NateRickard NateRickard self-assigned this Nov 5, 2020
@NateRickard NateRickard self-requested a review November 5, 2020 03:27
@Haarmees
Copy link

Haarmees commented Nov 5, 2020

Thanks for the response. I looked a bit at this PR and discovered this solution may not work for me either. I need to make long recordings, which I want to send to a server. So a memory stream may not be the right choice. I decided to implement my own solution, where you can give a stream to the StartRecording function:
var audioRecordTask = await recorder.StartRecording (myStream);
It will write the data to the provided stream. If no stream is provided, it falls back to writing a file.

I will make a PR for this functionality by the end of the week, if that's ok.
It should also cover this scenario, by giving a memorystream to the function.

@EverOddish
Copy link
Author

I can't remember if I had to make further changes to my pull request to get it working, but I can check when I have a chance. Let me know if there are any issues.

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

Successfully merging this pull request may close these issues.

None yet

3 participants