Delphi-Quellcode:
procedure TForm1.Button1Click(Sender:TObject);
begin
if Button1.Caption = 'PLAY' then
begin
Button1.Caption:='STOP';
Timer1.Enabled:=true;
sndPlaySound('C:\1.wav', snd_Async or snd_NoDefault);
end
else
begin
Button1.Caption:='PLAY';
Timer1.Enabled:=false;
sndPlaySound(nil, snd_sync or snd_NoDefault);
end;
end;
procedure TForm1.Timer1Timer(Sender:TObject);
begin
sndPlaySound('C:\1.wav', snd_Async or snd_NoDefault)
end;
Oder vielleicht auch das?!?