First off, I’m loving fmod. Thanks for a great piece of software.
I’ve been researching an issue I’ve been having intermittently which I would call a "stutter". What I mean by "stutter" is that it loops a short section of the audeo file (generally MP3 or WMA), about .3 seconds typically.
I’ve found references to stuttering that recommend changing the buffer size. I’ve tried both changing the number of buffers (to 16) and the buffer size (to 2048) with no luck.
The source is an audio file in all cases. I’m loading the sound using (C#):
m_system.createSound(fileName, (FMOD.MODE._2D | FMOD.MODE.HARDWARE | FMOD.MODE.CREATESTREAM | MODE.ACCURATETIME), ref sound)
I’m playing the sound using:
m_system.playSound(FMOD.CHANNELINDEX.FREE, m_currentSound, false, ref m_currentChannel)
Like I said, it’s intermittent (I know, impossible to diagnose!), but seems to happen most often at the start of the rendering, but not always. I’m hoping that someone out there has come across this and has something off the top of their head.
Thanks for anything!
- kc asked 10 years ago
you shouldnt be changing the mixer buffer size, that is not the thing that is stuttering. You would only change that if the repetition was very short and fast, which is usually an indication of a high cpu load or bad sound driver.
For streams, you should be looking at System::setStreamBufferSize and maybe decodebuffersize in FMOD_CREATESOUNDEXINFO
Are you using a creative labs card? If so try using software playback instead of hardware playback. I used to have stuttering issues with hardware accelerated audio on my creative card and using software fixed it in every application that I encountered it in. Not a fix by any means, but if it eliminates the problem that will at least help narrow it down.
- Janus answered 10 years ago
Hey, thanks Brett and Janus.
The problem has been happening on several different computers with different hardware and different versions of Windows. The length of the stutter was relatively close to the size of the decode buffer, so I suspect that’s a hint. I increased the size of the decode buffer to 44100 (44.1k max frequency * 1 second) and set the stream buffer size to be on the safe side and it looks like it has gone away for those that are having the problem (at least in early reports). So thanks!
After I looked up the function, I realized I should have found that in the manual. Thanks for pointing the way, Brett.
- kc answered 10 years ago
Please login first to submit.