XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Problem with manually looping xWMA file

Last post 9/29/2009 10:48 AM by anky. 3 replies.
  • 3/11/2009 1:45 PM

    Problem with manually looping xWMA file

    I have a problem with manually looping xWMA files. DirectX documentation suggests that if xWMA data is submitted as more than one buffer (as in case of streamed files), then the sound can only be looped manually by resubmiting the series of xWMA buffers. Consider the following code:

    XAUDIO2_BUFFER buffer = { 0 };
    buffer.pAudioData = someData; // someData contains the whole xWMA file data chunk.
    buffer.AudioBytes = someDataSize;

    XAUDIO2_BUFFER_WMA bufferWma = { 0 };
    bufferWma.pDecodedPacketCumulativeBytes = someWmaData; // whole dpds chunk.
    bufferWma.PacketCount = numWmaPackets;

    myVoice->SubmitSourceBuffer( &buffer, &bufferWma ); // myVoice is IXAudio2SourceVoice*.
    myVoice->SubmitSourceBuffer( &buffer, &bufferWma );
    buffer.Flags = XAUDIO2_END_OF_STREAM;
    myVoice->SubmitSourceBuffer( &buffer, &bufferWma );

    In this example, the whole file is loaded and looped manually. The first buffer is always played OK, but for every other buffer I get the following trace:
    e:\dxsdk\nov08\audio\wma\codecv10\wmaudio\decoder\msaudiodec.cpp(2291) : *** TRACE *** code = 0x6!

    Same thing occurs when I split the file into several buffers (then the trace usually pops up when the second buffer of every loop iteration is being played back), but in this case there is an additional problem: OnBufferEnd callback is not called for some buffers and I suppose it is related to that trace. Does anybody has an idea why this may happen?
  • 5/20/2009 4:38 AM In reply to

    Re: Problem with manually looping xWMA file

    StevenRS,

    I've run into the same problem. Have you figured out a solution to this?

    Does anyone know of a work around? What does the *** TRACE *** code = 0x6 error mean anyway?

    Thanks!

    -Dude
  • 6/5/2009 5:54 PM In reply to

    Re: Problem with manually looping xWMA file

    How are you handling the seek table data? That will need to be recalculated for each partial submit.
  • 9/29/2009 10:48 AM In reply to

    Re: Problem with manually looping xWMA file

    hello, how can i recalculate packet data?

    are you talking about
    In addition, when streaming an xWMA file a few packets at a time, the application should subtract pDecodedPacketCumulativeBytes[PacketCount-1] of the previous packet from all the entries of the currently submitted packet (C) DirectX help

    i tried to recalculate as followed but nothing happens to my playback.. I still get e:\dxsdk\aug09\audio\wma\codecv10\wmaudio\decoder\msaudiodec.cpp(2291) : *** TRACE *** code = 0x6!
Page 1 of 1 (4 items) Previous Next