sound in my game

sound(DATA,“ZgNAeABCQj4/Pj1DWQtwPxDT77u1THs/dQBHf0JFQD9AQj9A” ).

hello. I have this custom sound to hear when it rains, but I need this last long ringing sound, any suggestions … thanks :frowning:

How long is that sound in seconds? I believe you need to only play it once, let it finish, then play it again. Currently you are playing it 60 times per second by calling it every time a frame is drawn.

In your draw function, try something like this:

    if ElapsedTime > rainSound then
        rainSound = ElapsedTime + 2
        sound(DATA,"ZgNAeABCQj4/Pj1DWQtwPxDT77u1THs/dQBHf0JFQD9AQj9A" )
    end

In your setup function add this:

    rainSound = 0

You can then tweak “rainSound = ElapsedTime + 2”. To make it delay longer, increase 2. Decrease to shorten the delay.

Shorter delay makes it sound like heavier rain. Increasing the delay beyond 3 will give gaps between the rain sounds. To stop rain for let’s say 100 seconds, change 2 to something like 103. Make the 2 a variable and then you can change the delay on the fly.

sound (DATA, “ZgNAeABCQj4/Pj1DWQtwPxDT77u1THs/dQBHf0JFQD9AQj9A”)
when I place this sound in my draw function calling my functions for rain, the sound changes and sounds bad

function draw ()
rain: charge ()
sound (DATA, “ZgNAeABCQj4/Pj1DWQtwPxDT77u1THs/dQBHf0JFQD9AQj9A”)
rain: draw ()
end

excelent my sound is working good … thanks Slashin8r

thanks @Slashin8r #:-S #:-S