views:

122

answers:

1

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 the 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 is still there.

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.

Edit: I actually wrote a test for each game loop for whether the music is playing and apparently the music is playing. It's just that for some reason it isn't being heard.

+1  A: 

This could be a number of things. It could be an issue with the SDL_Mixer library you have, so you could try getting it again to rule that out. Your volume may have somehow got set to zero somewhere, so I would check the volume as a test. And the final thought would be that the source sound file you are playing is incompatible in some way (not likely if you can play it in another sound player, but possible). Besides those suggestions I don't believe I can help you any further with the data you have provided.

resolveaswontfix
The hack fix I did was to fade the music in rather than using PlayMusic and that worked. Hopefully for my next project I won't have the same problem.
trikker