I'm making a simple text rpg and battle system with C and I was just wondering if it was possible to add sounds to it. I've heard that it's possible with C++ but I'm not sure if it's possible with C as well.
Any help is greatly appreciated :)
You can use the Beep() function from the Win32 API.
That will sound at 82Hz for 600ms.
You can use the PlaySound() function also from Win32 to play a wave file.
You need to include the header windows.h.
Thanks for your help Colin Mac. But I found that what I really wanted was to use mciSendString.
And to answer apurvkolte's question, you can play mp3 files by using the mciSendString command. Here's an example code: mciSendString("play C:\\TheTarget.mp3", NULL, 0, NULL);
yes it is possible in c as well c++.
you need set frequency of sound to particular character then it will produce sound what you type.for reference-package of yashwant kanetkar is suitable.