Is there a way to get with precision a position during the playback?
Because I have a lot of functions which require
to play from a position A and make something to a position B precisely.
I have tried this:
void __fastcall TForm1::PlaySound(FMOD_SOUND snd)
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, snd, 0, &channel);
// attacher un callback pour surveiller la fin du morceau
result = FMOD_Channel_IsPlaying(channel, &playing);
result = FMOD_Channel_GetPaused(channel, &pausing);
FMOD_Channel_GetPosition(channel, &pos, FMOD_TIMEUNIT_MS);
if (pos == 1000)
Beep(440, 50); FMOD_Channel_Stop(channel); FMOD_Channel_IsPlaying(channel, &playing); // make something ... } Application->ProcessMessages();
The problem is sometimes the system has no time to determine the exact position playback.
But, if I do this:
if (pos >= 1000)
// do some thing …
It works very fine.
- tictactouc asked 13 years ago
- You must login to post comments