How to make audio loop seamless?

+1 vote
asked Feb 13 by Patrick Lauser (470 points)

Hello all!

I am using SugarCube 2.21, and using the audio macro for looping:

<<audio "test" loop play>>

But each time the sound repeats it stops and starts again instead of playing seamlessly, which is pretty useless as I am using it for an ambient, background sound.

Is there something that will play looped audio seamlessly?

I checked that the stop is not in the sound itself: the same sound loops seamlessly in Audacity.

Thank you in advance!

1 Answer

0 votes
answered 6 days ago by mazhem (1,090 points)
<<audio "ambient" stop>>
<<audio "ambient" play>>
<<repeat 42s>>
<<audio "ambient" stop>>
<<audio "ambient" play>>
<</repeat>>

bit of a hack, I quickly put together a sort of ambient track and doing a repeat and replacing the seconds in "repeat" with the length of your track should get you a more seamless play.

 

There might be a cleaner way but I've no clue what it'd be.

commented 6 days ago by Patrick Lauser (470 points)
It cuts out the delay alright, but still makes a "twitch" sound when it repeats. It also stops repeating when you go to another passage.

Another option I am thinking of is having two ambient tracks which fade in and fade out, offset so they make more or less a continuous background. To offset them it would be good to have a time delay which does not cancel when the passage is left.
commented 5 days ago by Patrick Lauser (470 points)
Actually, I think it would be better to have the two ambient tracks somewhat different lengths, so that they align differently each time they repeat, and it would give the ambiance a much less repetitive and more natural sound. They would rarely go silent at the same time, and it would no doubt fit well enough in the natural flow when they do.
commented 5 days ago by mazhem (1,090 points)
Give it a go! For ambient noises I've no clue what else would be good, though if you give a gradually fading beginning and end of the clip it would at least not be a jarring stop
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...