I have a game which is not real-time, that is the player can choose to go forwards and backwards in time at will. I would like my sound to play correctly forwards and backwards. My idea was to record when each sound started playing, then every frame check the time of the simulation, move all the effects to that time, then play one frame of time (we’re using a fixed timestep ).
After some searching, I found Channel::setPosition, which allows me to start when I need to, but I still do not know how to only play a certain segment of a sound file. Is there a way to specify the length of time I want a effect to play? Also, as long as I’m asking people who know things, will Channel::setPosition allow me to do what I have described?
- TooMuchJuice asked 10 years ago
Channel::setPosition will allow you to seek to any point in the sound.
Channel::setFrequency will allow you to set the speed of the playback. If you load the sounds as FMOD_SOFTWARE you’ll be able to set a negative frequency and play those sounds backwards. That should be enough to get you started.
- Guest answered 10 years ago
Its good to know that SetPosition will work, thanks.
Even with the ability to play backwards, I still need the sound to only play one frame, so 1/50th of a second of the file. The player can move the game forward one frame, and I want only the portion of the sound which should be played in that frame to sound off.
Please login first to submit.