Author Topic: Randomly playing sounds  (Read 1955 times)

Is it possible to have a sound play randomly instead of just having the loop play back to back? I want to have an ambient pack with for example a seagull sound that just plays randomly (Not just squee,squee,squee over and over again.)

You can do this manually by making tons of functions each with a different schedule to the next one.

You can do this manually by making tons of functions each with a different schedule to the next one.

actually you could just do

Code: [Select]
schedule(getRandom(1000,20000),0,functionThatPlaysYourSound);
and it would play the sound randomly at 1 to 20 second intervals. change the values in getRandom to change the possible intervals.

your gonna want to have more than one 'sqauk'. even if it is random, needs pitch and tone changes.

Lets here angry seagull, happy seagull, and my favourite; severly bloated seagull (Think of a really fat seagull which can't fly and must instead roll to get where its going).

I hope your going to include other cool ambients like: Road/street noises, Soccer/footbal game noises (fans cheering) and maybe a space ambience (really should be silent but you could go with the typical electronic sounds).