SDL_Mixer NOT WORKING??
Moderator: Coders of Rage
- lalacomun
- VS Setup Wizard
- Posts: 114
- Joined: Wed Dec 28, 2011 10:18 pm
- Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
- Programming Language of Choice: C++
- Location: Argentina
- Contact:
SDL_Mixer NOT WORKING??
Hi all its just that i am testing music on my engine but it wont play anything, the files are in the same folder, allready checked the Mix_GetError() and i dont have any, i tryed both .mp3 and .ogg and both of them didnt work. i tried making a basic program that just play music and it didnt worked either, but the mysterious thing is that i found a pen drive with old projects with SDL_Mixer and they worked! WTF??
PD: I have al dlls in the folder and i use code::blocks as IDE
PD: I have al dlls in the folder and i use code::blocks as IDE
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: SDL_Mixer NOT WORKING??
Did you call SDL_Init(), is the library linked properly, can you hear sounds form other sources?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: SDL_Mixer NOT WORKING??
Suck if you realised your speakers weren't plugged in :L
- lalacomun
- VS Setup Wizard
- Posts: 114
- Joined: Wed Dec 28, 2011 10:18 pm
- Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
- Programming Language of Choice: C++
- Location: Argentina
- Contact:
Re: SDL_Mixer NOT WORKING??
Yes, SDL is initialized, and yes its linked properly, and as i said before, i tried making a new project that just loads and play music and it didnt worked, but then i open a old file with a program that played music and it worked, i copy the exact same code innto a new project file but it didnt worked and by the way the old proyects(the ones that worked) were imported from devc++ to code::blocks, any suggestions??dandymcgee wrote:Did you call SDL_Init(), is the library linked properly, can you hear sounds form other sources?
- lalacomun
- VS Setup Wizard
- Posts: 114
- Joined: Wed Dec 28, 2011 10:18 pm
- Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
- Programming Language of Choice: C++
- Location: Argentina
- Contact:
Re: SDL_Mixer NOT WORKING??
LOL but for my disgrace i have a laptoptappatekie wrote:Suck if you realised your speakers weren't plugged in :L
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: SDL_Mixer NOT WORKING??
If you copied the same exact source, recompiled it, and it didn't work, it's almost definitely a linkage error. Are the .dll's in the correct place for runtime?
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: SDL_Mixer NOT WORKING??
Are you checking the return value of the function? Does it return a success value as if nothing went wrong?lalacomun wrote:any suggestions??
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- lalacomun
- VS Setup Wizard
- Posts: 114
- Joined: Wed Dec 28, 2011 10:18 pm
- Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
- Programming Language of Choice: C++
- Location: Argentina
- Contact:
Re: SDL_Mixer NOT WORKING??
yes i think so :pGinto8 wrote:If you copied the same exact source, recompiled it, and it didn't work, it's almost definitely a linkage error. Are the .dll's in the correct place for runtime?
these are the dlls i have:
libfreetype-6.dll
libogg-0.dll
libvorbisfile-3.dll
libvorbis-0.dll
SDL.dll
SDL_mixer.dll
SDL_ttf.dll
smpeg.dll
zlib1.dll
libfreetype-6.dll
hehehe correct me if there is some missing
and in the linkers i have -lSDL_mixer for the mixer, and the lib folder of SDL where i have the libs of mixer, ttf, and image
but the programs where the mixer worked are imported from devc++ to code::blocks i dont know if that make any difference but just saing
- lalacomun
- VS Setup Wizard
- Posts: 114
- Joined: Wed Dec 28, 2011 10:18 pm
- Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
- Programming Language of Choice: C++
- Location: Argentina
- Contact:
Re: SDL_Mixer NOT WORKING??
actually yes, i use the following codedandymcgee wrote:Are you checking the return value of the function? Does it return a success value as if nothing went wrong?lalacomun wrote:any suggestions??
Code: Select all
if (music1 == NULL)
{
fprintf(stderr, "Unable to load audio: %s\n", Mix_GetError());
}
Code: Select all
if(Mix_PlayMusic(music1, -1) == -1) {
printf("Unable to play music file: %s\n", Mix_GetError());
return 1;
}
- TheBuzzSaw
- Chaos Rift Junior
- Posts: 310
- Joined: Wed Dec 02, 2009 3:55 pm
- Current Project: Paroxysm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: SDL_Mixer NOT WORKING??
I gave up on SDL_Mixer. I reached a point where it flat out would not work in either Linux or Windows. Plus, even when it was working, the program added like 3 full seconds to both startup and shutdown of the program. I moved to OpenAL, which turned out to be much simpler to setup than I originally thought. The Internet is simply devoid of decent OpenAL tutorials.
- lalacomun
- VS Setup Wizard
- Posts: 114
- Joined: Wed Dec 28, 2011 10:18 pm
- Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
- Programming Language of Choice: C++
- Location: Argentina
- Contact:
Re: SDL_Mixer NOT WORKING??
yes, in my first program with SDL_Mixer i remember i needed to wait like 5 secs until the music started playingTheBuzzSaw wrote:I gave up on SDL_Mixer. I reached a point where it flat out would not work in either Linux or Windows. Plus, even when it was working, the program added like 3 full seconds to both startup and shutdown of the program. I moved to OpenAL, which turned out to be much simpler to setup than I originally thought. The Internet is simply devoid of decent OpenAL tutorials.
i think i am going to start with OpenAL