Reputation: 2175
Windows has so many APIs on this it is ridiculous. Supposedly MediaFoundation is the way to do this, but I see a lot of 'deprecated' in the MSDN documentation and the sample they provide is only for playing music from a URL. I have a compressed audio file in memory (mp3, m4a, etc). Right now I'm using their CPlayer example. ( https://msdn.microsoft.com/en-us/library/windows/desktop/bb970516(v=vs.85).aspx ).
Is there a way to have MediaFoundation load a source from memory? Or do I have to decompress it in a separate thread and feed it into XAudio2?
Upvotes: 2
Views: 223
Reputation: 750
Yes, it is possible with Media Foundation thanks to the IMFMediaSource
interface.
There is an article about this topic on MSDN : Writing a Custom Media Source
Regards,
Upvotes: 1