Le post date un peu, mais j'ai trouvé ça sur torry.net :
Comme ça, ça donne une deuxième méthode en plus de la mienne pour jouer plusieurs sons à la fois
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 uses MMSystem; procedure SendMCICommand(Cmd: string); var RetVal: Integer; ErrMsg: array[0..254] of char; begin RetVal := mciSendString(PChar(Cmd), nil, 0, 0); if RetVal <> 0 then begin {get message for returned value} mciGetErrorString(RetVal, ErrMsg, 255); MessageDlg(StrPas(ErrMsg), mtError, [mbOK], 0); end; end; procedure TForm1.Button1Click(Sender: TObject); begin SendMCICommand('open waveaudio shareable'); SendMCICommand('play "C:\xyz\BackgroundMusic.wav"'); SendMCICommand('play "C:\xyz\AnotherMusic.wav"'); SendMCICommand('close waveaudio'); end;
Partager