I want to put a Poke Battle Music.. i Use Dev-C++ because thats what our Teacher
Recommended us to use.. i don't know why i know its updated since 2005 and we know 2005 was ages ago.. as one user said to one of my post..
and also we were told to use the printf("Hello"); and scanf("%d", &gg);
not the cinn<< cout>> thing so i'm sorry if that adds to the problem of you helping me..
but i am hoping that some one can help me..
so thank you..
#include<stdio.h>
#include<unistd.h>
int main()
{
/*
* In The ASCII Table when you try to print the character
* present on location 7, You will hear a bell :)
*/
int bell_ascii_code = 7;
//Printing Caracter for Integer ASCII Value 7
printf("%c", bell_ascii_code);
//Waiting for 1 Second
sleep(1);
//Play 2 Bell Sounds
printf("%c", bell_ascii_code);
printf("%c", bell_ascii_code);
//Exit
printf("Exiting");
return 0;
}
Make Use of ASCII Table - Value 7 and Sleep to make a tone you want.
The only thing your default terminal provides is basic I/O. If you want fancy stuff, I suggest ditching the terminal and using a library like SFML. It has a high-level audio module, where you can easily do something like.
I'm sure there are other libraries that work with the terminal itself, but I have not used these, and either way, you'd need to download some library to get it to work.
Second, it sounds like you already know this, but if you are just doing this for fun and not for school, I highly suggest using a more up-to-date compiler than the one used with the original Dev-C++. Orwell Dev-C++ is probably similar to what you're used to, but it comes packaged with a more up-to-date compiler (mingw on windows?).
You can use "Bloodshed Dev C/C++", That is a lightweight IDE and is capable of doing almost everything.
You can download a package named "Allegro" and just #include<allegro.h>. This is a game programming library which will give you predefined functions to play .wav or .mp3 sounds.