• Advertisement
Sign in to follow this  

SDL Audio Help*solved*

This topic is 4917 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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'

Share this post


Link to post
Share on other sites
LOL, now thats fixed, now i have no errors, and my audio wont play.
heres my play function..

void PlayMuzic()
{
Mix_Music *music = NULL;
music = Mix_LoadMUS("sound1.wav");
Mix_PlayMusic(music, -1);
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement