🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
SDL Audio Help*solved*
Can some one tell me how to play a wav file(using SDL)?Is there a function for it or what?
Thanks.
[Edited by - Xabbu on September 3, 2004 9:08:07 PM]
"He had surived everything, developing a faciltiy that was the envy of players every where on the net. He was the most famous character in the Middle country game,recruited for every battle..first choice for every important task"
Use SDL_Mixer
SDL_Mixer Tutorial
SDL_Mixer Tutorial
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Alright, but now it says it can't find SDL_mixer.h, and im pretty sure i got my linker set up right.
gcc -g -o mixer1 mixer1.c `sdl-config --cflags --libs` -lSDL_mixer
is what you put in the linker, right?
gcc -g -o mixer1 mixer1.c `sdl-config --cflags --libs` -lSDL_mixer
is what you put in the linker, right?
"He had surived everything, developing a faciltiy that was the envy of players every where on the net. He was the most famous character in the Middle country game,recruited for every battle..first choice for every important task"
You use gcc? I use Visual Studio. Sorry, can help you past that...
well... if it can't find the header file, you probably need to set up the directories.
well... if it can't find the header file, you probably need to set up the directories.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
I have that fixed now, but now i get these errors
[Linker error] undefined reference to `Mix_LoadMUS' [Linker error] undefined reference to `Mix_PlayMusic'
"He had surived everything, developing a faciltiy that was the envy of players every where on the net. He was the most famous character in the Middle country game,recruited for every battle..first choice for every important task"
as best as I can tell, your .lib or .a files aren't in the right directory.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
LOL, now thats fixed, now i have no errors, and my audio wont play.
heres my play function..
heres my play function..
void PlayMuzic(){ Mix_Music *music = NULL; music = Mix_LoadMUS("sound1.wav"); Mix_PlayMusic(music, -1);}
"He had surived everything, developing a faciltiy that was the envy of players every where on the net. He was the most famous character in the Middle country game,recruited for every battle..first choice for every important task"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement