0
0

I’m a newbie to fmod doing a quick job for someone.

How can I reverse a sound? If I’ve loaded it from disk (createSound), I can play it and I can set the speed, but only > 0. How do I play it backwards?

(And no I’m not investigating the last tracks on Black Sabbath records…).

Thanks

Iain

  • You must to post comments
0
0

Unfortunately, no FMOD product is capable of playing an audio file backwards. If you want to give the impression of a track running backwards in a game, the easiest option is to cheat and play a file that [i:19hwgjaa]sounds[/i:19hwgjaa] like it’s being rewinded – possibly even using a backwards version of the audio file prepared using another DAW.

EDIT: I was wrong. As explained below, it is entirely possible to play a sound backwards.

  • You must to post comments
0
0

Thanks Joseph.

In a post I found elsewhere ([url:60npw87r]http://gmc.yoyogames.com/index.php?showtopic=333705&st=260&p=3146454&#entry3146454[/url:60npw87r]), I read that if you called FMODGroupSetPitch() with pitch -1, the sound would play backwards. Clearly this is from an earlier version of the library (non object oriented).

Would this have worked? Would it work now? or do I have to look elsewhere?

Thanks

  • You must to post comments
0
0

Further to this topic, I note that the help file says of software that it supports Reverse sample playback.

I’ve tried the following:-
result = system.createSound("../../../../../examples/media/wave.mp3", FMOD.MODE.SOFTWARE | FMOD.MODE.CREATESAMPLE, ref sound1);
ERRCHECK(result);
result = sound1.setMode(FMOD.MODE.LOOP_OFF);
ERRCHECK(result);

result = system.createChannelGroup("Group A", ref groupA);
ERRCHECK(result);

result = system.playSound(FMOD.CHANNELINDEX.FREE, sound1, false, ref channel);
ERRCHECK(result);
result = channel.setChannelGroup(groupA);
ERRCHECK(result);

And then later
FMOD.RESULT result = groupA.setPitch(<pitch>);

This code works fine until the pitch is set below zero. At this point, the sample ceases to play.

Can you clarify how to get reverse sample playback as per the help file?

Iain

  • You must to post comments
0
0

You can in fact play an FMOD sound in reverse, to do this set the frequency (Channel::setFrequency) to be negative.

So if the current frequency is 48000Hz, set it to -48000 for normal speed reverse playback. Keep in mind that this feature is limited to non-streaming FMOD::Sound objects loaded as FMOD_SOFTWARE.

  • You must to post comments
0
0

I think the issue is that you’re not setting the position of the sound to the end before starting it backwards.

edit: to add to mathews post you cannot use FMOD_CREATECOMPRESSEDSAMPLE either.

  • You must to post comments
0
0

Thanks to all. This is correct.

You set the sound going backwards using a negative frequency. You can change the rate going backwards (or forwards) using setPitch.

Iain

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.