procedure TForm1.Button1Click(Sender: TObject); begin with MediaPlayer1 do begin FileName := 'ni!.wav'; AutoRewind := True; Open; { Open Media Player } try Wait := True; { Waits until sounds is done playing to return } Play; { Play sound } Play; { Play again after first playing is completed } finally Close; { Close media player } end; end; end;
begin
with MediaPlayer1 do
begin
FileName := 'ni!.wav';
AutoRewind := True;
Open; { Open Media Player }
try
Wait := True; { Waits until sounds is done playing to return }
Play; { Play sound }
Play; { Play again after first playing is completed }
finally
Close; { Close media player }
end;
end;
end;