4 #include "SDL_mixer.h" //Docs: http://www.libsdl.org/projects/SDL_mixer/docs/
5 //example http://www.kekkai.org/roger/sdl/mixer/
7 static struct termios stored_settings
;
9 struct termios new_settings
;
10 tcgetattr(0,&stored_settings
);
11 new_settings
= stored_settings
;
12 new_settings
.c_lflag
&= (~ICANON
);
13 new_settings
.c_cc
[VTIME
] = 0;
14 new_settings
.c_cc
[VMIN
] = 1;
15 tcsetattr(0,TCSANOW
,&new_settings
);
19 tcsetattr(0,TCSANOW
,&stored_settings
);
29 Mix_Music
*play_sound
= NULL
;
30 Mix_Chunk
*play_sound2
= NULL
;
33 Mix_FreeMusic(play_sound
);
34 Mix_FreeChunk(play_sound2
);
40 int main(int argc
, char* args
[])
42 SDL_Init(SDL_INIT_EVERYTHING
);
43 Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT
, 2, 4096);
45 play_sound
= Mix_LoadMUS("/home/harvie/Downloads/Shared/Shaggy-Mr._Bombastic.mp3");
46 play_sound2
= Mix_LoadWAV("bd.wav");
48 Mix_PlayMusic(play_sound
, 0); //(Mix_Music, loops) -1 = infinite loop, 0 = play 1time
49 Mix_PlayChannel(-1, play_sound2
, 9);
51 //while(Mix_PlayingMusic() || Mix_Playing(-1)) sleep(1);
52 puts("press any key to exit!"); gethit();
This page took 0.257594 seconds and 4 git commands to generate.