Delphi XE6 Firemonkey TMediaPlayer – delay in sound play

  

I just simply want to play audio file when the button is clicked. I made simply code and when I clicking the button, the sound appears in about 1 second delay, I want to hear it immediately, any suggestion ?

procedure TForm1.btnSound(Sender: TObject);
begin
S:=’C:\click.wav’;
mediaplayer1.FileName:=S;
mediaplayer1.play;
end;

Comments are closed.