0
0

Hi!

What’s the best way to handle playback of multiple files that need to be in sync?

Using Delphi 6, I tried a modification of the FMOD Testbed play function, that iterates through the number of loaded files, and starts playback (see below). It works, but I guess there are more elegant solutions.

Regards / Jonas


for index := 0 to lbxFiles.Items.Count – 1 do
begin
if FSongs[Index].Playing then btnStopAllClick(Sender);
if FSongs[Index].Stream <> nil then
begin
FSongs[Index].Channel := FSOUND_Stream_Play(FSOUND_FREE, FSongs[Index].Stream);
FSongs[Index].Playing := FSongs[Index].Channel >= 0;
FSOUND_SetPan(FSongs[Index].Channel, FSOUND_STEREOPAN);
FSOUND_SetVolume(FSongs[Index].Channel, 255);
if not FSongs[Index].Playing then
Application.MessageBox(FMOD_ErrorString FSOUND_GetError), ‘Play stream’, MB_OK or MB_ICONHAND);
end;
end;
ShowStaticSongInfo(Index);

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.