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

AudioFileReader with Byte Array #927

Open
pvoelker opened this issue Aug 6, 2022 · 6 comments
Open

AudioFileReader with Byte Array #927

pvoelker opened this issue Aug 6, 2022 · 6 comments

Comments

@pvoelker
Copy link

pvoelker commented Aug 6, 2022

I have a file format that embeds byte arrays of sound files.

I would like to AudioFileReader with a byte array. Is there currently a way to do this?

It would almost be nice if AudioFileReader had an override that took a stream instead of a file name. The audio format would need to be provided in this case...

Any thoughts? I would be willing to work on a PR with such an override for AudioFileReader?

@pvoelker
Copy link
Author

pvoelker commented Aug 6, 2022

MediaFoundationReader does not have an option to take a stream, so this gets a little more complicated. Tinkering around with a local clone to see if I can get something working...

@markheath
Copy link
Contributor

Take a look at StreamMediaFoundationReader - someone already contributed that but haven't had time to work with it much myself, so not sure how reliable it is.
https://github.com/naudio/NAudio/blob/master/NAudio.Wasapi/StreamMediaFoundationReader.cs

@pvoelker
Copy link
Author

pvoelker commented Aug 7, 2022

I think I have something that works. I am putting together test cases. Is there a preference on a branch name?

@pvoelker
Copy link
Author

pvoelker commented Aug 8, 2022

Or should I do a fork? Sorry, just want to make sure I am following your process...

@pvoelker
Copy link
Author

pvoelker commented Aug 8, 2022

I've created a PR: #929

This will allow me to load a memory stream with the byte data and pass it into AudioFileReader.

Let me know if there are any changes or suggestions you would like to see. I did not see documentation around AudioFileReader on it's own. I see it used in other examples. Didn't know if you wanted me to add anything to documentation...

@Alex-van-der-Peet
Copy link

Why has this not been accepted? It's a brilliant improvement, I need it too!

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

3 participants