locked
Add another sound file to XAudio2 audio file playback sample

    Question

  • Hello All.

    I'm running the metro sample project "XAudio2 audio file playback sample." I'm able to run the sample successfully.

    Now, I'm trying to add my own sound file to the project.  However, the files that I create don't seem to work with the project.

    What format are the sound files in (counting_adpcm.wav, electro_adpcm.wav, heli_adpmc.wav, etc.) and are there any tools that I can use to create files with the same format?

    Thanks in advance.

    Wednesday, April 18, 2012 9:41 PM

Answers

  • There is a problem with the "BasicAudio" class code. During the load of the wave file simply remove the failing check for:

    format == sizeof(WAVEFORMATEX)

    For some reason the size of the WAVEFORMATEX structure is not being calculated correctly by the runtime. Simply removing this check allows standard uncompressed wav files to be loaded. I haven't tested with 3rd party ADPCM files.

    I haven't had the time to look into why this check is failing unexpectedly on standard wav files. More investigation is needed but I can confirm that just removing the check works fine.

    I hope this helps,

    James


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

    Friday, April 27, 2012 11:05 PM
    Moderator

All replies

  • Hello STL,

    We have had other reports of this problem with this particular sample. I'm not sure what is going on here. Please give me a day or two to take a closer look at the issue and I will get back to you. If you don't hear from me by Friday EOD please make sure to bump this post.

    Thanks,

    James


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

    Wednesday, April 18, 2012 11:48 PM
    Moderator
  • Hello STL,

    We have had other reports of this problem with this particular sample. I'm not sure what is going on here. Please give me a day or two to take a closer look at the issue and I will get back to you. If you don't hear from me by Friday EOD please make sure to bump this post.

    Thanks,

    James


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

    i have a problem with this too, the chunk size not compatible with Adobe Auditions format

    which software did you use to converting ?

    Wednesday, April 25, 2012 4:50 PM
  • I was trying to use Audacity with not much luck.  I tried to make a Microsoft ADPCM file in Audacity.  However, those files still would not work in Visual Studio project.

    Wednesday, April 25, 2012 6:29 PM
  • in 3D Shooting game sample the MediaReader is better  .wav loader, that is working with normal pcm wav

    Wednesday, April 25, 2012 9:57 PM
  • There is a problem with the "BasicAudio" class code. During the load of the wave file simply remove the failing check for:

    format == sizeof(WAVEFORMATEX)

    For some reason the size of the WAVEFORMATEX structure is not being calculated correctly by the runtime. Simply removing this check allows standard uncompressed wav files to be loaded. I haven't tested with 3rd party ADPCM files.

    I haven't had the time to look into why this check is failing unexpectedly on standard wav files. More investigation is needed but I can confirm that just removing the check works fine.

    I hope this helps,

    James


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

    Friday, April 27, 2012 11:05 PM
    Moderator