Keine Ahnung, was du da machst:
Delphi-Quellcode:
unit Unit2;
interface
uses
MMSystem, Classes;
type
TPlayWave =
class(TThread)
private
{ Private-Deklarationen }
public
FFilename:
String;
constructor Create(Filename:
string);
protected
procedure Execute;
override;
end;
implementation
{ TPlayWave }
constructor TPlayWave.Create(Filename:
String);
begin
Inherited create(True);
FFilename := Filename;
FreeOnTerminate := True;
Resume;
end;
procedure TPlayWave.Execute;
begin
sndPlaySound(PChar(FFilename), SND_ASYNC);
end;
end.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
WaveThread: TPlayWave;
begin
WaveThread := TPlayWave.Create(ExtractFilepath(Paramstr(0))+ 'Beeth5th.wav');
end;