How should I do if I want to play a wave file backwards?
Any suggestions?

I’ve read that I should use FSOUND_SetFrequency() and the FSOUND_SetCurrentPosition().
But how?

I am very new to music and sound programming.
Please help me

I’ve manage to play a wave file “forward”. That was quite easy to do. Thanks FMOD!

best regards Christer Ottosson, Sweden.

  • You must to post comments

Hi again everybody.

I manage to get i to work. I needed to start the playback of the wave file before i used the SetFrequency() and SetCurrentPosition().

Hears the code for playing wave files backwards.

[code:1gg5kmes]//init the sound done before...

int length = NULL;

// Get the length of the wave file.
lenght = FSOUND_Sample_GetLength(samplePointer);

// Start to play the wave file.
FSOUND_PlaySound(0, samplePointer);
// Set the position at the "last" (almost) data.
FSOUND_SetCurrentPosition(0, (length-1) );
// Set the frequence to a negative so it will play backwards.
FSOUND_SetFrequency(0, -44100);

// Do nothing until the wave file is finnished playing.

// Shutdown and cleanup...[/code:1gg5kmes]

best regards Christer Ottosson

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.