As you know ,to play a WAV sound, you can use a TMediaPlayer object.
This article shows that how can playing a wav file without TMediaplayer.
--------
declared in the mmsystem unit
........
function PlayWav(const FileName: string): Boolean;
begin
Result := PlaySound(PChar(FileName), 0, SND_ASYNC);
end;

procedure StopWav;
var
buffer: array[0..2] of char;
begin
buffer[0] := #0;
PlaySound(Buffer, 0, SND_PURGE);
end;

-------------------------------
//Example:

procedure TForm1.Button1Click(Sender: TObject);
begin
PlayWav('c:\windows\media\start.wav');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
StopWav;
end;

相关文章:

  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2022-02-14
  • 2021-12-12
  • 2021-11-28
  • 2022-12-23
  • 2021-08-02
相关资源
相似解决方案