How to play the sound of an object sliding on another object for a variable duration
- by Antoine
I would like to add sound effects to a basic 2D game. For example, a stone sphere is rolling on wood surface. Let's say I have a 2 second audio recording of this. How could I use the sample to add sound for an arbitrary duration ?
So far I have two solutions in mind:
a/ record the sound for an amount of time that is greater than the maximum expected duration, and play only a part of it;
b/ extract a small portion of the sample and play it in a loop for the duration of the move; however I'm not sure if it makes sense with an audio wave.