0
0

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?

  • You must to post comments
0
0

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.

-Pete

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

If you want to play a portion of a sound look into FMOD_DELAYTYPE_DSPCLOCK_END / setDelay

  • You must to post comments
0
0

Thanks, that seemed to work.

  • You must to post comments
0
0

[quote="TooMuchJuice":318xtcln]Thanks, that seemed to work.[/quote:318xtcln]

I would do the same.
Can you post a little example?

Best,
Franco

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.