user1054922
user1054922

Reputation: 2175

Play compressed audio from memory in Windows 7/8/Store C++

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

Answers (1)

M'hand BOUGHIAS
M'hand BOUGHIAS

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

Related Questions