I have a couple of sound files that are used to generate random music, each section has it’s own audio file and is made to seamlessly change to the next section. Each section has multiple different audio files to choose from. Is there any way to create a Sound object that will play from these files and choose a different selection on the sound being looped. So every time it loops it plays something different.
If you’re using the low level API, you can seamlessly queue up sounds with Channel::setDelay.
You need to start your first sound at a specific clock value, then calculate the length of the sound in output samples. this is outputsamples = sound_length_pcm / sound_samplerate * output_rate.
Add that outputsample value to your original clock value to tell you when to start the 2nd sample.
output_rate is 48khz usually for example (use System::getSoftwareFormat) and the sound sample rate is from Sound::getDefaults.