locked
Decode to custom renderer or media sink.

    Question

  • I want to decode audio data and stream the raw audio stream to a custom server (no PlayTo device).

    Using IMFMediaEngine, I can add custom source or transform objects, but I cannot add a custom renderer or media sink. The MediaCapture class lets me render to a target sink, but I cannot use my audio file as a source, only existing "devices". The MediaTranscode class allows output to stream, but it seems limited to only a few codec/container options. Also, I guess it always wants to use a container, whereas I would want the raw sample stream without any header.

    What would be the best way to achieve this?

    I could write a custom "audio effect" transform and add it to IMFMediaEngine. There I could grab the decoded audio data and send it to the server. To prevent the app from actually playing the sound through the speakers, I could output empty samples from the "audio effect" to the renderer in IMFMediaEngine. However, this seems like a very hackish solution. There must be a better way. Sadly, the interfaces that would allow me to do this in a clean way seem to have all been removed from WinRT.

    Did I overlook something? Any ideas?

    Monday, February 04, 2013 11:52 AM

Answers

  • Nevermind, I found it out myself:

    IMFSourceReader seems to be what I need:

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



    • Marked as answer by Lukas F Monday, February 04, 2013 1:19 PM
    • Edited by Lukas F Monday, February 04, 2013 1:20 PM
    Monday, February 04, 2013 1:19 PM

All replies

  • Nevermind, I found it out myself:

    IMFSourceReader seems to be what I need:

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



    • Marked as answer by Lukas F Monday, February 04, 2013 1:19 PM
    • Edited by Lukas F Monday, February 04, 2013 1:20 PM
    Monday, February 04, 2013 1:19 PM
  • Thanks for sharing.

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 05, 2013 2:45 AM