• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Audio Not Working

L

Lo_Z

Guest
Hi all, I'm making a big game (with a lot of features) with GMS 1.4.1804. Now when I'm asking to play a sound at the creation event of a object, the sound not play. The sound I wanna play is an ogg, this is how I use:

CREATION EVENT:
chswa=audio_play_sound(snd_chsw,100,1);
audio_sound_gain(chswa,0.5,0);
audio_sound_pitch(chswa,1);

END STEP EVENT:
audio_sound_pitch(chswa,sp); -sp is a variable to synchronize with speed of animation

Now the sound must play in loop, but it doesn't, or better, it play for 0,0001 sec.
I've tried to draw a variable when audio play, but he returns ever the sound not exists.
I also tried to play the sound in the "end step" event:

if !audio_exists(chswa) audio_play_sound(snd_chsw,100,1);

but as result the game play a quick sound like continuously tapping a pencil on the table, instead of make a huge noise.
In a room with just the object for the music it work, but in a room with a lot of instances (also if noone is playing audio) it doesn't work.
Maybe game maker can't handle games too big? or can be my pc that can't handle it? or there is a way to make it works?
 
L

Lo_Z

Guest
DukeSoft, it go from 0 to 1.3.
But I've get why it doesn't work now.:oops:
I've added one by one the instances and find that two with "audio_sound_pitch(eng,sp)" make the problem, cause:

"eng=0" and not "eng=audio_play_sound(.....)"

So, I'm Sorry!:D
But thanks for the feedback!
 
Top