SDL audio code

Pages: 1234
closed account (NUj6URfi)
Can someone please post the SDL code to load a wav file and play it please? Thanks in advance.
closed account (NUj6URfi)
Bump.
closed account (S6k9GNh0)
It's not a SDL forum. Why not ask on their mailing list (although you'll definitely be flamed).
closed account (NUj6URfi)
I've gotten sdl help before. Please? I have tried sdl forums before. They are horrible.
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
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.
closed account (S6k9GNh0)
We have nothing to go on.
i have no any IDEA.... :( i am also facing this problem...
toad1359 wrote:
Lazyfoo doesn't cover this.

What's wrong with the Playing Sounds tutorial?
http://lazyfoo.net/SDL_tutorials/lesson11/index.php
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.
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.
closed account (NUj6URfi)
I am including sdlmixer and sdl and stdio and sdl_image.
undefined reference means you're probably not linking to the right libs. You need to link to the SDL mixer lib.
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.
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).
closed account (NUj6URfi)
I typed in what I typed for sdl image but I changed image to mixer and it's still not working.
what IDE are you using?
closed account (NUj6URfi)
Dev-c++ 4.9.9.2. I have a feeling I am loading but not playing the audio.
Wait... I thought you were getting a linker error?
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