Rapid Repeat Sounds

avengre

15-09-2010 18:07:58

Is there any method for having a sound start before the last instance or Play() of it has?

I'm trying to make a mouse Over noise using CEGUI, and it works great. However the sound takes ~ 0.5s to play. If the mouse is moved quickly across multiple buttons, a new sound won't play until the last one has played.

I keep a sound instance loaded which is called via a Manager, ie AudioManager->playMouseOverClick();

I assumed this would be faster than releasing and recreating the sound name every time the mouseOver occurs.


Short of checking if the sound exists, creating a unique name for it, loading the sound, playing it, and deleting it for every instance... is there a better way?

stickymango

15-09-2010 21:22:08

Hi,

What you can do is call: sound->stop();
sound->play();


that will reset the sound to the beginning but will mean you only use one soond, in the majority of cases this is fine.

If, however, thats too slow or cropping the sound isn't desirable you'll need to create 2/3 copies of the sound and manage how they're played in a 'round-robin' system.

HTH