我在MediaPlayer的属性AutoOpen设为True,DeviceType设为dtWaveAudio,FileName设为一个目录下的.wav文件,当我调用MediaPlayer的play方法时没有反应,请问这是怎么回事?另外MediaPlayer的Wait方法我也调用了,还是不行.多谢了!

解决方案 »

  1.   

    with mediaplayer1 do
      begin
       filename:='*.wav';
       autoopen:=true;
       devicetype:=dtwaveaudio;
       open;
       play;
      end;
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    with mediaplayer1 do
      begin
       filename:='f:\mp3\test.wav';
       autoopen:=true;
       devicetype:=dtwaveaudio;
       open;
       play;
      end;
    end;
    这样写可以运行,但是没有反应.我把相应的文件删除后程序没有出错
      

  3.   

    autoopen 设置为false
    只要写
    mediaplayer1.open;
    mediaplayer1.play;
    就可以了  那个device 没有用
      

  4.   

    with mediaplayer1 do
      begin
       filename:='*.wav';
    Mediaplayer1.Open
    Mediaplayer1.Play;
    Mediaplayer1.Record;
    Mediaplayer1.Back;
    Mediaplayer1.Previous;
    Mediaplayer1.Step;
    Mediaplayer1.Next;
    Mediaplayer1.Eject;
      

  5.   

    先加一个BUTTON吧,Mediaplayer1.Open,然后直接PLAY
      

  6.   

    devicetype必须设置为dtautoselect;