XAudio issues RRS feed

  • Question

  • I've got a game I'm developing, but It's having various issues with the audio. The game has background music playing along with sound effects. My problem is that, at various times, the background music will seem to drop in volume when sound effects play. Also, some sound effects seem to not play at all, randomly.

    More or less, my audio manager is similar to the audio playback sample. I'm generally looking for advice or if anyone has an idea what the most common culprit based on these symptoms could be. I'm not terribly great with audio, so I don't know any of the formats I need. Or what kind of formats the Wave files should be. Generally, I need some advice with successfully integrating DirectX audio into a game.


    [url=http://catalog.create.msdn.com/en-US/GameDetails.aspx?catalogEntryId=5cbacba6-05c2-4c33-9005-6cc80c8d5753&type=1]Bible Trivia Avatar Edition[/url], currently in review.

    Monday, September 30, 2013 3:39 AM


All replies

  • Have you enabled the XAUDIO2 debug output and looked for warnings that coincide with these drop outs?


    Monday, September 30, 2013 8:06 PM
  • I took the link below and transplanted their code into my program and had something working in half an hour.



    Wednesday, October 2, 2013 8:49 PM
  •  I fell foul of loading in sound files that failed to load occasionally. This caused the app to hang as the software was waiting for the sound file to load correctly.

    I found in the load routine I had to return different values depending on whether the load worked or caused an exception. It didn't fail very often but when it did it was disasterous and failed certification.


    Saturday, October 5, 2013 8:38 PM
  • I loaded in the soundfile then played the sound but had problems.

    In the loading in part I set a flag once the file was loaded and se ta failed flag if it didn't load.

    This worked fine on my PC but kept hanging during certification.

    I found I had to put the playing of the sound in the load file continuation.

    For some reason sometimes the load file part didn't set any flags and my program was waiting forever for a result causing a hang.


    Wednesday, October 9, 2013 8:34 PM
  • After doing a complete overhaul of my AudioManager, now based upon the "First person shooter" sample, I've run some of my sounds and come upon a problem. When m_sourceVoice->SubmitSourceBuffer(&buffer) is called I get the following error reports:

    XAudio2: AudioBytes (82924) not aligned to the audio format's block size (8)

    XAudio2: Invalid source buffer

    [url=http://catalog.create.msdn.com/en-US/GameDetails.aspx?catalogEntryId=5cbacba6-05c2-4c33-9005-6cc80c8d5753&type=1]Bible Trivia Avatar Edition[/url], currently in review.

    Sunday, October 13, 2013 1:37 AM