Originally Posted by
kikika
Hello everyone!
I'm taking a programming class (introduction to C language) and for the final project we are writing the code for a game.
My knowledge is pretty basic since this is a introductory class but still, to get some extra points (IN EXTREME NEED OF THAT ) I have to add some "frills", and one of the things I was thinking about was to add sounds, somehow (I already googled it but couldn't find anything).
Do you know by any chance if there's any sound function/command in the stdio.h or any other c library and how could I implement that in my code?
Again, nothing fancy please, I'm just a beginner!
Thank you in advance for your contribution.
PS: Feel free to suggest any simple frills that you may know.
Thanks again!
If you are on a Windows machine, and have a set of Windows headers and libs you can do this...
Code:
#include <windows.h>
#include<mmsystem.h>
// beep bop and burble
Beep(1000,100);
// play actual music and effects
Playsound("MyNoise.wav",NULL,SND_FILENAME);
Read more here --> PlaySound