Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sound files

Status
Not open for further replies.

nicasa

Programmer
Feb 3, 2003
54
ES
Hi There,

I am currently developing an application called audio quiz which requires the user to listen to questions rather than read them.
Currently, I am using a 'system(mplayer2.exe filename.wav)' function call to invoke the standard win media player and allow the user to listen to a .wav file. This does not seem very satisfactory and am wondering how I can play .wav files without explicitly making a system call.

I know that you can create a .rc file at design time which will compile all resources (.wav files here) into a .res file directly.

Are there other better ways to use sound files that the user can either specify or can be read from a text file.

What help resources are available on dealing with resources ?

All help much appreciated,


Steven Matthews

 
Hello.

You can use the standard TMediplayer component that already comes with C++Builder to play wav files.C++Builder help as a lot more info and examples.

Also you can use PlaySound WinAPI ,

PlaySound("c:\\TestSound.wav",NULL,SND_FILENAME);

then you can use this line to stop the playing

PlaySound(NULL, NULL, NULL);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top