How to get raw data of decoded mp3 file in metro style ? RRS feed

  • Question

  • Dear all,

    How can I get raw data from a mp3 file in metro style ?

    WinRT api seems doesn't have the api to the task.

    MediaEncodingProfile doesn't support PCM.


    Best regards,


    Friday, March 9, 2012 10:40 AM


All replies

  • You can get the raw data by opening the file and reading the raw bytes.


    It is up to you to interpret that data however you want!

    Jeff Sanders (MSFT)

    Friday, March 9, 2012 1:55 PM
  • Hi, ipsanders,

    Sorry, my quesiton is not clear. I know I can use StorageFile to open read a file.

    I wonder how to decode mp3 file and get the decoded data in metro style.

    I know a mp3 file consists of id3tag and frames. Does metro style supply the

    suitable class or api to decode the frames into the buffer, then I can get the

    decoded raw data(not compressed audio data) to use.

    I know MediaEncodingProfile can do audio format transform, but someone said

    Developer Preview disabled this feature. So, I need to find another way to get

    decoded raw data from mp3 file in metro style.


    Best regards,


    Sunday, March 11, 2012 2:52 AM
  • Hello dupre,

    This is actually fairly easy using Media Foundation, C++ and modern COM. Take a look at the IMFSourceReader interface. This should do what you need.

    Win32 and COM for Metro style apps (multimedia)


    IMFSourceReader interface


    I hope this helps,


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, March 15, 2012 12:34 AM
  • Dear James,

    Thanks for your helpful advice, I will try it.

    Best regards,


    Friday, April 6, 2012 2:32 AM
  • Bumping this for clarification...

    If I were to create an IMFSourceReader on any sort of audio file, as long MF in Windows knows how to decode it, I'll be getting decoded samples?

    Saturday, November 17, 2012 2:09 AM