Prueba con algo así:
Código Delphi
[-]
type
TSound = class(TThread)
private
FPath: String;
protected
procedure Execute; override;
public
constructor Create(Path: String);
end;
uses mmsystem;
constructor TSound.Create(Path: String);
begin
FPath:= Path;
FreeOnTerminate:= TRUE;
inherited Create(FALSE);
end;
procedure TSound.Execute;
begin
while not Terminated do
begin
if FPath <> '' then
PlaySound(PChar(FPath),0,SND_FILENAME or SND_SYNC)
else
Sleep(10);
end;
end;
Y para usarlo:
Código Delphi
[-]
with TSound.Create('C:\WINDOWS\Media\Chord.wav') do
begin
ShowMessage('Pulsa aceptar para terminar');
Terminate;
end;