Jump to content
  • Advertisement
Sign in to follow this  
munawar

[SLIMDX] XAudi2 Streaming Choppy

This topic is 3169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I am using the August 2009 release of SlimDX and XAudio2--I've found that streaming a file works more intuitively with this API than with DIrectSound. I have an ogg file which I am streaming like this: 1. First decode a block of data into Pcm. 2. Create a AudioBuffer from that data. 3. Submit the buffer. 4. When we have maxBuffers buffers queued in the SourceVoice, start playback--this will give us enough time to create and submit more buffers. 5. Until we start running out of queued buffers, sleep. 6. Create a new buffer with more ogg to Pcm data, and submit it. 7. Do this procedure until there's no more data to be read in to buffers, and wait for the currently queued buffers to stop playing, then return. My problem is, the audio is very choppy (E.G. I can distinctly tell when the playback moves from one buffer to the next.) It's not a delay issue, since I tried loading several buffers at once, each containing a segment of the sound, and played it when all buffers were loaded. I still got the same results. Is there any flag I have to set to tell XAudio2 to make the transition from one buffer to the next a smooth one, or am I totally missing something here? I'm pretty sure I have the block alignment and sampling rate etc correct. Thanks for any assistance! This is my first time doing something this complicated using XAudio, so please be as secific as possible when providing me with a solution. :) Munawar

Share this post


Link to post
Share on other sites
Advertisement
Hi,
Just a quick update, I solved the issue. Just letting you know so it doesn't get registered a spotential SlimDX problem. I had set my buffers' loop counts to 1--a simple logic error. Everything's working fine now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!