SDL audio code

Pages: 1234
Jul 30, 2013 at 11:02pm
closed account (NUj6URfi)
Can someone please post the SDL code to load a wav file and play it please? Thanks in advance.
Jul 31, 2013 at 12:17am
closed account (NUj6URfi)
Bump.
Jul 31, 2013 at 1:27am
closed account (S6k9GNh0)
It's not a SDL forum. Why not ask on their mailing list (although you'll definitely be flamed).
Jul 31, 2013 at 8:56pm
closed account (NUj6URfi)
I've gotten sdl help before. Please? I have tried sdl forums before. They are horrible.
Jul 31, 2013 at 10:13pm
closed account (Dy7SLyTq)
well help you but we wont write code for you, unless you mean the functions/structs used, in which case you can google that as well as we can
Jul 31, 2013 at 10:23pm
closed account (NUj6URfi)
On dev-c++ the sdl tutorial for this doesn't work. Lazyfoo doesn't cover this. The problem is just before my program loads the audio the program freezes.
Aug 1, 2013 at 5:31am
closed account (S6k9GNh0)
We have nothing to go on.
Aug 1, 2013 at 8:31am
i have no any IDEA.... :( i am also facing this problem...
Aug 1, 2013 at 9:22am
toad1359 wrote:
Lazyfoo doesn't cover this.

What's wrong with the Playing Sounds tutorial?
http://lazyfoo.net/SDL_tutorials/lesson11/index.php
Aug 1, 2013 at 2:26pm
Peter87 wrote:
What's wrong with the Playing Sounds tutorial?


It uses SDL 1.x


Although a quick glance of the SDL 2.0 documentation makes it look like the API for audio has not changed (still does software mixing... ewwwwwww) so that tutorial should still work.
Aug 2, 2013 at 10:28pm
closed account (NUj6URfi)
I am using sdl 1.2 or whatever. Anyways I get 4 errors. All undefined references to mix close open load and free.
Aug 2, 2013 at 10:35pm
closed account (NUj6URfi)
I am including sdlmixer and sdl and stdio and sdl_image.
Aug 3, 2013 at 4:11am
undefined reference means you're probably not linking to the right libs. You need to link to the SDL mixer lib.
Aug 3, 2013 at 12:03pm
closed account (NUj6URfi)
My mixer code is

1
2
3
4
5
6
7
8
		  
    Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 );
music = Mix_LoadMUS( "Aw screw that.wav" );

		  
    Mix_FreeMusic( music );
    Mix_CloseAudio();
while(exited==0){


I didn't use any of the font stuff. Nothing happened.
Aug 3, 2013 at 4:49pm
The code you're using doesn't matter. Adding the lib to the linker input options is done in your IDE's linker settings or in your compiler's commandline options (if you're not using an IDE).
Aug 3, 2013 at 9:56pm
closed account (NUj6URfi)
I typed in what I typed for sdl image but I changed image to mixer and it's still not working.
Aug 3, 2013 at 9:58pm
what IDE are you using?
Aug 4, 2013 at 12:45am
closed account (NUj6URfi)
Dev-c++ 4.9.9.2. I have a feeling I am loading but not playing the audio.
Aug 4, 2013 at 12:46am
Wait... I thought you were getting a linker error?
Aug 4, 2013 at 12:54am
closed account (NUj6URfi)
Now it's not working meaning that it's not playing. I forgot the play music line of code but it still doesn't work.
Pages: 1234