Question

The only thing I found was with MediaFoundationReader which seems to work only with files. But I want to play a stream, not a file. Is there a way to do that?

Was it helpful?

Solution

NAudio's Media Foundation support is quite new, so not everything is supported as yet. Unfortunately stream-based playback is one of the features that isn't supported yet.

Check out this answer from Mark to a similar question about MF support for streams.

If you're keen to get in and implement it yourself you will need to create a wrapper class that implements the IMFByteStream interface, then adapt the NAudio MediaFoundationReader class to use streams. I did something similar in this answer for the WmaFileReader and WmaStream classes to use a stream-based source for NAudio's Windows Media Audio support.

OTHER TIPS

Just, after two more years since the last comment, I stumbled upon this question. I assume the OP's software is C#, as he wants to use NAudio.

Exactly that is done in the QIRX SDR (Open Source, I'm the author), by using P/Invoke and a suitable wrapper,without using IMFByteStream.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top