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

Streaming XWM

Last post 06-06-2008 2:27 AM by Duncan. 2 replies.
  • 06-04-2008 3:31 PM

    Streaming XWM

    Hello! I try to make streaming wma (usual has earned - thanks to Dugan and Jammy1986). Basically, all works. But I wish to learn - whether correctly I do. I read from a file on 8917*2 bytes (8917 is my XMA2WAVEFORMATEX wfx.nBlockAlign) m_wma_buffer. PacketCount = readed_size () / 8917; m_wma_buffer.pDecodedPacketCumulativeBytes always = data from "dpds" chunk. Like normally would work but if to try to increase the size of the block for reading for example up to 8917*4 the sound starts to generating "jerky". Please, prompt me how correctly playing streaming sound. Sorry for my awful english.
  • 06-04-2008 5:23 PM In reply to

    Re: Streaming XWM

    The most important part of streaming audio is to make sure that you queue enough audio to cover your next read operation latency. You should not wait until one buffer is played out before you start the next buffer -- there needs to be at least two buffers (and often three) in the pipeline to avoid break-ups in the audio.
    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 06-06-2008 2:27 AM In reply to

    Re: Streaming XWM

    “m_wma_buffer.pDecodedPacketCumulativeBytes always = data from "dpds" chunk”
    Note the data can only be used directly from the “dpds” chunk if one submits the entire file (i.e. all the packets) in one call.  When streaming a file a few packets at a time, the application should subtract pDecodedPacketCumulativeBytes[PacketCount-1] of the previous buffer submitted from all the entries of the currently submitted buffer.

    For example if you want to submit just the first two packets of a file,
    pDecodedPacketCumulativeBytes would point to an array containing the values:
    Entry[0]
    Entry[1]
    Where the entries correspond to the data from the "dpds" chunk, as before.

    However, submitting the next to packets of the file, pDecodedPacketCumulativeBytes would point to an array containing:
    (Entry[2] – Entry[1])
    (Entry[3] – Entry[1])

     

    Duncan McKay [MS]
    The Game Audio Team needs you (Software development engineer position open): http://forums.xna.com/forums/t/14399.aspx
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG