Hi Everyone!
This is my first post on this great BBS.
Is there any way to play .WAV (or any other extension) file(s) within my C programs?? i mean without having to open a media player to play that WAV file(s)..
Thanks in Advance..
Hi Everyone!
This is my first post on this great BBS.
Is there any way to play .WAV (or any other extension) file(s) within my C programs?? i mean without having to open a media player to play that WAV file(s)..
Thanks in Advance..
My Tutorials :
- Bad programming practices in : C
- C\C++ Tips
(constrcutive criticism is very welcome)
- Brain Cell
>Is there any way to play .WAV (or any other extension) file(s) within my C programs??
Yes. But with the information you've given it's impossible to tell you how.
My best code is written with the delete key.
What kind of info do you need?? im just looking for a standard method (a function maybe?) that allows me to run audio files within any program. Or atleast point me to a tutorial that shows me how.
I've searched for it but all what i found was for VB and some other languages..
My Tutorials :
- Bad programming practices in : C
- C\C++ Tips
(constrcutive criticism is very welcome)
- Brain Cell
there is no standard way to do it. The only sound functionality that is built into C is a system beep. You will have to look for a library or api that you like to play sound.
Under Windows it will be nearly impossible to program a sound engine. One thing you can do though is fire up DirectX and DirectSound and use DirectSound for playing WAVs.
But if you want to code your own you will have to be in pure DOS - Windows does not like it when you program the DMA controller and service hardware interrupts. It will really screw your code up and cause it to fail giving you the false impressions that your code is broken. I've encountered this before. In Windows my sound engine died and in pure DOS it worked perfectly.
Proceed at your own risk.
naa it's so simple !!!!!!!!!
http://msdn.microsoft.com/library/de...dplaysound.asp
en example :
sndPlaySound("C:\\WINDOWS\\Help\\Tours\\WindowsMed iaPlayer\\Audio\\Wav\\wmpaud5.wav", SND_ASYNC);
remember the system pause coz u need time to play the sound
Couldn't he just use SDL?
Warning: Opinions subject to change without notice
The C Library Reference Guide
Understand the fundamentals
Then have some more fun
Is fine for one sound. Not good from within DirectX and not good for programs that need robust sound systems.sndPlaySound(" C:\\WINDOWS\\Help\\Tours\\WindowsMediaPlayer\\Audi
o\\Wav\\wmpaud5.wav", SND_ASYNC);