I am currently working on a project that involves recording a person’s spontaneous rhythm.
I using FMOD Ex v4.32.05 (according to the header file).
I have a quick simple shell setup that loads in some wav files and plays them when i press the number keys.
The time at which I press the key to the time I hear the sound is noticeably delayed. I have checked that there is no delay between a keypress and the app response, and my update cycles average out to less than 5µs (0.000005s)! I’m really doing practically no other code other than playing the sounds.
I have checked the wav files and there is no silent area at the beginning of them.
To Load my wav file I simply use:
[code:4tem2m37]m_pFMODSystem->createSound(filename, FMOD_HARDWARE, 0, ppSound);[/code:4tem2m37]
and to play I simply use
I setup the buffer size and number with
which improved it somewhat, but I can still notice that there is a delay and I’m not convinced that there isn’t a way to improve it, I mean, I’ve never seen any problem in games that have a sound as a physics response for example, or a gunfire. You wouldn’t expect to have a noticeable delay between clicking your mouse and hearing a gun shot, or seeing a ball hit a wall and hearing the bounce..
I’ve also tried using FMOD_SOFTWARE instead.
Any suggestions? Is there something specific I should be doing to prime the sound ready to play, so that when playSound is called, its already buffered up and ready?
- swifty666 asked 8 years ago
The conventional wisdom is that you always want to run FMOD in software mode. That way you get consistent results across computers, avoid driver/hardware drama, generally get lower latency outpt, and sometimes even get lower CPU utilization.
- audiodev answered 8 years ago
Upon further investigation, I have found that the delay differs a lot from PC to PC, I have found that on my housemate’s PC who has a "VIA High Definition" driver (OnBoard), and my mini laptop which has a "IDT High Definition Audio" (OnBoard) the delay is massivly better and very difficult to notice, vs my "Creative SB X-Fi" (SoundCard) which is really offputting in it’s delay of around 80ms or so (sounds small i know, but it’s easily noticable).
Please could someone help me to fix this for PCs with sound cards, I can only assume that the delay is caused by interfacing to the hardware, and that fmod is sending sound data as and when playing a sound, how can I make sure the soundcard is primed with the data ready for play upon human input?
- swifty666 answered 8 years ago
Please login first to submit.