locked
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.

    Thanks.

    Best regards,

    dupre

    Friday, March 9, 2012 10:40 AM

Answers

All replies

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

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefile.aspx

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


    Jeff Sanders (MSFT)

    Friday, March 9, 2012 1:55 PM
    Moderator
  • 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.

    Thanks.

    Best regards,

    dupre

    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)

    http://msdn.microsoft.com/en-us/library/windows/apps/hh452756.aspx

    IMFSourceReader interface

    http://msdn.microsoft.com/en-us/library/windows/apps/dd374655.aspx

    I hope this helps,

    James


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

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

    Thanks for your helpful advice, I will try it.

    Best regards,

    dupre

    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