Link to home
Start Free TrialLog in
Avatar of rpm_bmbz
rpm_bmbz

asked on

Delphi Sounds

I want to play a 2 second *.wav file while my splash screen is loading but I cant the the mediaplayer component to work...
Avatar of wkz
wkz

maybe its the loading of the program itself that jams up the *.wav file. did you try putting the mediaplayer component on another thread and running it from there?
uses MMSystem,



 sndPlaysound('E:\2.wav',SND_FILENAME+SND_RESOURCE);


use this API to play the wav file
have u tried  
 
procedure TForm1.FormCreate(Sender: TObject);
begin
//MediaPlayer1.FileName:= ...    (only needed if u haven't set the file in the object inspector)
MediaPlayer1.AutoRewind:=False;
MediaPlayer1.Open;
MediaPlayer1.Play;
end;
Avatar of rpm_bmbz

ASKER

I'm trying your suggestions i'll get back with you shortly
ASKER CERTIFIED SOLUTION
Avatar of m_stevens
m_stevens

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial