SDL_Mixer peculiar sound issues

Basic Info:

Programming Language - C++

Platform - Windows

Audio Formats - wav and mid

I recently finished a game and was fooling around with figuring out the best way to upload it to a file hosting site. I eventually decided on using 7zip’s self-extracting feature. However, I think the mistake I made was that instead of just copying what I needed to another folder and zipping that up for the distribution (i.e., not copying source files, etc.) I rearranged the actual folder that held all of my source files etc. and split it into 2 sub folders for the C++ files, and then everything else (that folder being the one that got zipped up.)

I tested downloading it and playing it and it worked fine. However, I went back because I decided to change the background music and that’s when a…peculiar problem started happening.

To sum the problem up, Mix_PlayMusic() is being called and is working correctly. However, for some reason no sound is playing (and neither are any of the sound effects called from Mix_PlayChannel()). The odd thing is that you can hear the music when Mix_FadeOutMusic() is called. I also have a sound toggling feature, but after thorough testing I’ve come to the conclusion that it isn’t the problem.

I finally decided to create a completely new project and just bring all of the files I needed into that project in the same “organization” that they were in originally. However, the problem still occurs.

I have no idea what’s wrong. The files are being loaded in fine, it’s just that when the music is supposed to be playing (and according to testing it is), it’s not playing. This also applies to sound effects.

I actually wrote a test for each game loop to output to a game log whether the music is playing and apparently - the music is playing. For some reason though, sound can only be heard through calling a fade out function.

I’d like to elaborate on what I believe the real issue is.

Mix_PlayMusic() technically “plays” the music (according to testing with PlayingMusic), but no sound can be heard.

However, sound can be heard if I call Mix_FadeMusicOut(). It seems that somehow Mix_FadeMusicOut() is opening the sound channel or doing something that Mix_PlayMusic() is not.

I “solved” the problem by using Mix_FadeInMusic instead of Mix_PlayMusic(). Still odd, but it works.

----- F?ljande ?r ett automatiskt svar
----- p? ditt meddelande till @Andreas1

-------------- next part --------------
An embedded message was scrubbed…From: alexs91@vt.edu (trikker)
Subject: [SDL] SDL_Mixer peculiar sound issues
Date: Sun, 18 Oct 2009 11:11:35 -0700
Size: 9501
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20091019/2e3f5d93/attachment.eml

----- F?ljande ?r ett automatiskt svar
----- p? ditt meddelande till @Andreas1

-------------- next part --------------
An embedded message was scrubbed…From: alexs91@vt.edu (trikker)
Subject: Re: [SDL] SDL_Mixer peculiar sound issues
Date: Sun, 18 Oct 2009 16:50:54 -0700
Size: 5975
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20091019/4d20cf05/attachment.eml

----- F?ljande ?r ett automatiskt svar
----- p? ditt meddelande till @Andreas1

-------------- next part --------------
An embedded message was scrubbed…From: alexs91@vt.edu (trikker)
Subject: Re: [SDL] SDL_Mixer peculiar sound issues
Date: Sun, 18 Oct 2009 16:33:25 -0700
Size: 6466
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20091019/64216dcf/attachment.eml