How to put music in Dev-C++ Bloodshed

Write your question here.

1
2
3
4
5
6
7
8
  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..
Last edited on
Well, Here is One way to do it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#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.
thank you but can i like use an mp3 file? or Wav?

i meant C language btw.. i think lol
like calling a file type? to play?
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.
1
2
3
4
sf::Music music;
music.openFromFile("music.ogg")
music.setLoop(true);
music.play();


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?).
Last edited on
hahaha our school recommends us to use bloodshed but thanks for your answer :)
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.

Here are the tutorials:
http://www.youtube.com/watch?v=_UJHSWRvcrc


You can watch the whole series or you can just watch about the specific things like sound, mouse

Note: Whatever is shown in the tutorials can be done using Bloodshed IDE :)
Last edited on
thank you so much
Topic archived. No new replies allowed.