I am new to this forum, so I hope it is the right topic I am posting my question in.
I am using audacity in Windows 10, and wanted to know if it’s possible to script
that when I am opening a wav file which contains multiple tracks, the first track that plays alters randomly.
I would like to script, that it either starts with track 0, 1 or 2.
Also it would be desirable, if the tracks following after the first one are also chosen randomly.
I need it for a slot game I am programming.
Everytime you spin the reels there is a background sound
but it shouldn’t be always the same.
The background sound is programmed to be feeded from a single *.wav file.
The first time you click spin it should randomly decide which track the wav file is
playing.
So to say, everytime you access the file it chooses one of the 3 tracks randomly.
So do you want six versions of the WAV file, one with the sounds in the orders “1, 2, 3”, “2, 1, 3”, “2, 3, 1”, “3, 1, 2”, “3, 2 1”, and finally “1, 3, 2”?
Ok, it’s a bit trickier because they are different lengths.
How does your app know how long, and from what start point to play the sound?
For example, if the “random” order is “3, 2, 2, 3” then to play the 4th sound (sound 3), it must start at 1.087 + 0.280 + 0.280 = 1.647 seconds, and play for 1.087 seconds.
The programm knows that it should play the sound as long as the reels spin.
Now, the single sounds are shorter than the reel spin time, but audacity merges the tracks.
Unfortunately, I can’t tell the programm to start off from second e.g. 2 in the wav file,
so I thought everytime it is played, a different track would play.
If the length difference poses a problem, I can try to make them all the same length
Ok, now I ran it with the debug function and, in short, it returned: “error: In EXTRACT-ABS, 3rd argument (sound) must be a sound, got a 2-channel SOUND”