- Get the total duration of a file
- Specify the duration of your sound bite i.e 10s
- Having all this information, you know that your sound bite can start at any point between 0s and durationInSeconds - soundDuration
- Now you need to generate the random soundbite start using:
- Once you've got the start, add the sound bite duration to it, convert to new y and write as a new sample