locked
XAudio2 API usage along with streaming Video playback

    Question

  • Is there any example code that shows video playback (Movie streaming) along with Audio effect using XAudio2 ?


    Can XAudio2 API take PCM raw data ? Or Does it has to be WAV format? Please advise.

    Thursday, May 03, 2012 5:30 PM

Answers

  • Hello Patenlniraj,

    I'm not sure what you are looking for. There aren't any examples that I know of that use XAudio2 and video at the same time. However, I have been able to successfully mix video from a C++ Cx XAML Media Element with XAudio2 music and SFX in the background. Unfortunately this is an ongoing project and I can't post the source just yet. Rest assured that this works just as expected and should not be too much trouble to get up and running.

    Take a look at the following sample for mixing Direct3D with XAML and XAudio2. You can easily extrapolate adding a Media Element to this example to mix XAudio2 and the Media Element.

    DirectX 3D shooting game sample (XAML)
    http://code.msdn.microsoft.com/windowsapps/Metro-style-DirectX-18f98448

    I hope this helps,

    James


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


    Thursday, May 03, 2012 10:32 PM
    Moderator

All replies

  • Hello Patenlniraj,

    I'm not sure what you are looking for. There aren't any examples that I know of that use XAudio2 and video at the same time. However, I have been able to successfully mix video from a C++ Cx XAML Media Element with XAudio2 music and SFX in the background. Unfortunately this is an ongoing project and I can't post the source just yet. Rest assured that this works just as expected and should not be too much trouble to get up and running.

    Take a look at the following sample for mixing Direct3D with XAML and XAudio2. You can easily extrapolate adding a Media Element to this example to mix XAudio2 and the Media Element.

    DirectX 3D shooting game sample (XAML)
    http://code.msdn.microsoft.com/windowsapps/Metro-style-DirectX-18f98448

    I hope this helps,

    James


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


    Thursday, May 03, 2012 10:32 PM
    Moderator
  • Hi James,

    Thank you . This will help . Also I am seeking another information . I am trying to add custom post processing in Metro Application. For this I am using custom MFT in my C# Metro application.  Though I am able to add audio effect using custom MFT but I dont know how to  access custom interface implemented in MFT in my C# Metro app . I need to pass audio tuning parameters from Metro app to MFT to modify/optimize audio post processing effect. Can you guide me an example code or how to access custom interface part of MFT from C# Metro App.

    Niraj

    Friday, May 18, 2012 5:51 PM
  • Please look at this thread for more inforation:

    How to pass IMFAttributes/IPropertySet to MediaCapture.AddEffectAsync() or MediaElement.AddVideoEffect()?
    http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/f140c786-032a-4892-b502-baae0127a5cb

    -James


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

    Friday, May 18, 2012 9:51 PM
    Moderator
  • Take a look at the following sample for mixing Direct3D with XAML and XAudio2. You can easily extrapolate adding a Media Element to this example to mix XAudio2 and the Media Element.

    DirectX 3D shooting game sample (XAML)
    http://code.msdn.microsoft.com/windowsapps/Metro-style-DirectX-18f98448

    Hello James

    I'm planning to develop a guitar tuner app (Windows 8 Store App) and so I'm  trying to capture audio from a microphone device and want to process the input with XAudio2 to get the pitch, etc.:

    • Capturing Audio --> I will use Windows.Media.Capture.MediaCapture
    • Processing Audio --> I will use XAudio2 (together with SharpDX to use XAudio2 from C#)

    You wrote it is possible to mix XAudio2 and the Media Element. I couldn't bring this to light! Can you please give me a simple example for mixing XAudio2 with MediaCapture?

    Many Thanks :-)

    Tuesday, December 11, 2012 10:28 AM