这是最快的方式:
原文链接:https://www.f2er.com/windows/372484.htmluses MMSystem; procedure TForm1.Button1Click(Sender: TObject); begin sndPlaySound('C:\Windows\Media\Tada.wav',SND_NODEFAULT Or SND_ASYNC Or SND_LOOP); end; procedure TForm1.Button2Click(Sender: TObject); begin sndPlaySound(nil,0); // Stops the sound end;