Please can any one tell me how to open an audio file in C Program?
I came across a function "fopen", but i think its for opening text file. If i m wrong with that, can anyone tell me how to open audio file using "fopen".
Printable View
Please can any one tell me how to open an audio file in C Program?
I came across a function "fopen", but i think its for opening text file. If i m wrong with that, can anyone tell me how to open audio file using "fopen".
There are three ways that I know of to play an audio file:
MCI
waveOut
DirectSound
I haven't really used them that much, so I can't help you at all with how to use them. Google their names to find out about them.
Thanks i will try it.
If you just want it to open in the app that the user has installed for that file type (Winamp, Windows Media Player, etc) try ShellExecute
Cprogramming.com FAQ > Run a program from within a program
simplest way is with PlaySound() from Winmm.lib
Code:char szFullPath[MAX_PATH]="c://sounds//somesound.wav";
PlaySound(szFullPath, NULL, SND_FILENAME);