以前Delphi6写的一个程序,你再调调。
unit frmMain_Unit;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls,MMSystem;type
  TfrmMain = class(TForm)
    lTimer: TLabel;
    Timer: TTimer;
    procedure TimerTimer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    
    function GetCurTime(CurSecond: integer): string;
    procedure TestPlaySound;
  public
    { Public declarations }
  end;var
  frmMain: TfrmMain;
  CurSecond: integer;
  hh, mm, ss: Integer;implementation{$R *.dfm}function TFrmMain.GetCurTime(CurSecond: integer): string;
var
  m, s: string;
begin
  mm := CurSecond div 60;
  if mm < 10 then
    m := '0' + inttostr(mm)
  else
    m := inttostr(mm);
  ss := CurSecond mod 60;
  if ss < 10 then
    s := '0' + inttostr(ss)
  else
    s := inttostr(ss);
  Result := m + ':' + s;
end;procedure TFrmMain.TestPlaySound;
var
  Path : String;
begin
  Path := ExtractFilePath(ParamStr(0))+'Test.mp3';
  PlaySound(pchar(Path),0,snd_nodefault);
end;procedure TfrmMain.TimerTimer(Sender: TObject);
begin
  lTimer.Caption := GetCurTime(CurSecond);
  dec(CurSecond);
  if lTimer.Caption='01:00' then
    TestPlaySound;
  if lTimer.Caption='00:00' then
  begin
    Timer.Enabled:=false;
    lTimer.Font.Color:=clRed;
  end;
end;procedure TfrmMain.FormCreate(Sender: TObject);
begin
  CurSecond:=12*60;
  lTimer.Caption := GetCurTime(CurSecond);
  Timer.Enabled:=true;
end;end.