I have asked a similar question before, but maybe I didn’t make myself clear enough. The problem is that if I play a sound file with a simple monotonous sound, like for instance a flute, and then stop the sound by using the set paused command, there are some sound distortions as the sound ceases. There is a kind of a muffled thump or faint clicking accompanying or following the cessation of the sound, but which might vary in degree with different sound files. If you for instance have a series of play sound commands in short intervals, this might be very prominent. I could edit the sound file so that it has a fade out in the end, and then it would be okay if I play the file all the way. But I want to be able to stop the sound at any point in time.
This is unlike an electronic keyboard instrument: Where you hold down a key, and when releasing it, the sound stops, but without any sound distortions, no muffled thump or whatever. This is the effect I need to achieve. I therefore wonder if anyone can give me some ideas how this can be done in hopefully a simple way.
Thanks in advance.
- Varun asked 5 years ago
Granted that I understood it correctly, I was not able to make it work. I did the following:
case WM_LBUTTONUP :
FMOD_Channel_SetMute(channel, true); FMOD_Channel_SetDelay( channel, FMOD_DELAYTYPE_DSPCLOCK_END, 500, 500);
But there is still this thump sound after the sound has stopped. Did I do it wrong or might there be other ways to handle this?
- Varun answered 4 years ago
FMOD Ex does stop the sound dead where it is , so it can instantly be re-used.
If you dont mind some voices hanging around a bit longer, you can use setMute(true) first, then a frame or 2 later use stop.
A way to automate that stop is to use Channel::setDelay and FMOD_DELAYTYPE_DSPCLOCK_END in conjunction with muting the voice.
Please login first to submit.