Hello KMagic.
The solution is here :
http://forum.lazarus.freepascal.org/index.php/topic,23479.msg140408.html#msg140408
Thanks
=>
..
procedure TForm1.Button1Click(Sender: TObject);
var
Player1 : TUOS_Player ;
begin
Player1 := TUOS_Player.Create(True, self);
Player1.AddIntoDevOut; //// add a Output with default parameters
Player1.AddFromFile('MyWav.wav');
Player1.EndProc := @ClosePlayer1;
Player1.Play;
end;
procedure TForm1.ClosePlayer1;
var
Player2 : TUOS_Player ;
begin
sleep(2000);
Player2 := TUOS_Player.Create(True, self);
Player2.AddIntoDevOut; //// add a Output with default parameters
Player2.AddFromFile('MyWav2.wav');
Player2.EndProc := @ClosePlayer2;
Player2.Play;
end;
procedure TForm1.ClosePlayer2;
var
Player3 : TUOS_Player ;
begin
sleep(2000);
Player3 := TUOS_Player.Create(True, self);
Player3.AddIntoDevOut; //// add a Output with default parameters
Player3.AddFromFile('MyWav2.wav');
Player3.EndProc := @ClosePlayer3;
Player3.Play;
end;
etc...Please, read carefully that code...
It will , when you click on the button, create a new player, assign a Input (here a audio-file), assign a output (here out device of your sound card) and, the important thing:
assign a procedure to execute when the thread (the player) has terminated.
When all that is done it will play the player (player1.play).
That end-procedure (EndProc), closeplayer1, will first, wait 2 seconds, then , like for player1, also create a new player2, assign in-output and assign also a EndProc (closeplayer2),
When all that is done it will play the player2 (player2.play).
That end-procedure (EndProc), closeplayer2, will first, wait 2 seconds, then , like for player2, also create a new player3, assign in-output and assign also a EndProc (closeplayer3),
When all that is done it will play the player3(player3.play).
That end-procedure (EndProc), closeplayer3, will first, wait 2 seconds, then , like for player3, also create a new player4, assign in-output and assign also a EndProc (closeplayer4),
When all that is done it will play the player4 (player4.play).
.... => how many times you have song to play...
When you get it, feel free to invent a loop procedure to do that...