• 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!

SOLVED Get audio back after setting volume to 0

J

Jagoldrick

Guest
Hi,
I've been messing about with text writing noises and was trying to get a different sound to play whenever "...." was the displayed text. I found that making the audio = 0 for the standard text noise worked the best, as if I didn't do this the sound would play once or twice whenever the ellipsis sound had ended. However, the regular text noise now won't play after being set to 0 volume then standard volume again once the ellipsis is over. Does anyone know a fix to this?
(Ellipsis text -- page 4 = ellipsis -- DibDV = standard text noise -- DVDot = ellipsis text noise)
GML:
if(page == 4) { audio_sound_gain(Sou_DibDV, 0, false);
    if(!audio_is_playing(sou_DVDot)) {
        if charcount != string_length(txt[page]) {
    audio_play_sound(sou_DVDot, 0, false) } }
        else if(page != 4){ audio_sound_gain(Sou_DibDV, 1, false)} }
(Standard text)
GML:
if(!audio_is_playing(sou_DVDot)) { if(!audio_is_playing(Sou_DibDV)) {
    if(charcount mod 2 == 0) {
    if charcount != string_length(txt[page]) {
    audio_play_sound(Sou_DibDV, 1, false) } } } }
 

Pixel-Team

Master of Pixel-Fu
You could set the sound gain for a sound just before you play that sound, rather than set the gain in an if statement separate and apart from playing the sound, which may or may not get set.
 
J

Jagoldrick

Guest
You could set the sound gain for a sound just before you play that sound, rather than set the gain in an if statement separate and apart from playing the sound, which may or may not get set.
That's fixed it I think - the sounds play when they're supposed to but they occasionally overlap, which will be easy enough to fix. Thanks for your help!
 
Top