looping sounds

smappdi
28 Nov 2010, 09:51
What's the easiest way to loop a sound?

slackers_inc
28 Nov 2010, 21:07
The easiest way to loop a sound is to save your sound file as a .wav. Then open up the script editor in QDK and select "Pictures & Sounds" from the tree, then select "Play a wave sound". There should be an option box that says "loop" just browse for your file and then after selecting it click the loop box.. click ok and you're done. :)

If you're looking to loop an mp3 file the best thing I can think of is to set up a timer.

smappdi
30 Nov 2010, 09:09
Yeah I want to loop an mp3. I wonder why a looping option isn't built in, like with wavs.

A timer could work but it wouldn't be a perfect loop unless I cut the length of my sound files to a whole integer, which isn't something I want to worry about. Otherwise the timer setting wouldn't match the length of the sound precisely, and there'd be a skip sound in between loops.

Richarius
29 Dec 2010, 12:36
smappdi wrote:Yeah I want to loop an mp3. I wonder why a looping option isn't built in, like with wavs.

A timer could work but it wouldn't be a perfect loop unless I cut the length of my sound files to a whole integer, which isn't something I want to worry about. Otherwise the timer setting wouldn't match the length of the sound precisely, and there'd be a skip sound in between loops.


There's also a very high chance of having a 'click'/'thump' type sound at your loop point. Your best chances at preventing this are having your looping point occurring at the centre crossing line of the audio's waveform, with the ending point and the beginning points of the waveforms being as close to the same direction to each other as possible.
You can try to redraw the beginning and ending waveforms at maximum zoom in an audio editor. If the angles of the waveform's lines are altered though, you'll be changing the amplitudes of the related harmonics, at that point which again, can result in a 'click'/'thump' in the resulting audio.

Another method could be to crossfade the loop points. (Mix in a gradual fadeout of the end of the sample, with a gradual fade in of the beginning of the sample. These can work quite well at times depending on what your actual audio source is. If it's music or speech, this could be something of a problem. If it's background audio - forest; wind; waves; etc., you'd have a greater chance of success.)

Rich