bonjour,
Sans installer de composants:
Dans uses ajoutez process
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
25
26
27
28
29
30
31 function PlaySoundLnx (fileName: String): Boolean; const playerCmd = 'paplay'; // pulseaudio client playerCmd = 'paplay'; var AProcess: TProcess; begin AProcess := TProcess.Create(nil); with Aprocess do begin CommandLine := FindDefaultExecutablePath(playerCmd) + ' ' + filename; try try Execute; except on E: Exception do ShowMessage(E.ClassName + ' erreur , avec message : ' + E.Message); end; finally Free; end; end; end; procedure TForm1.Button1Click(Sender: TObject); begin PlaySoundLnx('qopen.wav'); end;
Partager