• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Game Music either sounds awful or is overlapping, I can't quite tell

N

NoTheOtherMatt

Guest
So I'm working on a game for my nephew to give to him for his birthday, a simple platformer with collectibles. I've gotten jump and landing sounds down pat, item collecting is no problem, but the game music is attempting ear murder.

I'm just using a simple line when the menu or level is created, for purposes of discussion we'll say menu.

audio_play_sound(snd_Menu,1,true);

I've tried OGG, WAV, and MP3 and on my PC and in the GMS2 preview it sounds great, but as soon as I hit play the music sounds like it was recorded by sticking a megaphone to a grocery store speaker and pointing it in the general direction of a $2 garage sale mic, I really have no better way of explaining it and I don't have a screen/sound capture on my computer to give you s clip.

I can't tell on the menu, but at the beginning of the level music it's a simple piano and it almost sounds like there's a few of the track layered at intervals of maybe a millisecond, so I'm not sure if it's an audio quality drop issue, or if for some reason it's playing multiples on top of each other.

So I guess my questions are: has anyone run into this before? What was your fix? Do you have any idea why this might be happening?
 

FrostyCat

Redemption Seeker
Chances are that you have multiple instances of the object playing the music, or you placed that line somewhere that runs more than once. I've never had issues with sound playing badly in any version of GM where it is done properly and plays at all.
 
I agree with Frosty that it could be multiple instances playing all at once. Have you done the standard catch of only allowing a sound or piece of music to play if it is not already playing?

Code:
if !audio_is_playing(snd_Menu)
{
  audio_play_sound(snd_Menu, 1, true);
}
If the above code doesn't fix it, it would probably be really helpful if you can record a video so we can see and hear what is actually happening. Then we may also need to see some more code of what else you do when creating and running your menu.
 
N

NoTheOtherMatt

Guest
I agree with Frosty that it could be multiple instances playing all at once. Have you done the standard catch of only allowing a sound or piece of music to play if it is not already playing?

Code:
if !audio_is_playing(snd_Menu)
{
  audio_play_sound(snd_Menu, 1, true);
}
If the above code doesn't fix it, it would probably be really helpful if you can record a video so we can see and hear what is actually happening. Then we may also need to see some more code of what else you do when creating and running your menu.
YES!!!!!!! Worked perfectly thank you!!! Still not sure WHY it was playing multiples, but this fixed it, thank you so so much!
 
Top