回复人:WuHeHai(河海) (2001-4-15 18:05:00)  得10分 
我给你一个实际例子。本人已顺利运行unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, MMSystem, MPlayer ;type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
begin
  PlaySound(PChar('C:\WINNT\Midia\Ding.wav'), 0, 0);
  //注意:第二参数应为0,而不是null
  // 第三参数由你自己需要决定
end;end. 

解决方案 »

  1.   

    使用SndPlaySound吧,当然,Use MMSystem First.
    参见MSDN.
      

  2.   

    to:rh(强硬的毛主席万岁!伟大的周总理万岁!) ,首先先谢谢您对我的大力支持,我相再问一下如何让该声音停下来?我按下按纽后按纽就死在那里了。另如何同播另一个声音?
      

  3.   

    播放时用PlaySound(FILENAME,0,SND_ASYNC|SND_FILENAME);
    停止用PlaySound(0,0,0);
    也可在尚未播放完成时继续播放另一个声音,但将停止播放原来的声音。
      

  4.   

    to mountlin(怎么办) 我好象按纽按下去后,声音没播完,按纽就激不活了?