Gapless Playback

removed by user

Are you asking about “loop play” with “shift + spacebar” or something else?
For loop play to loop without a glitch at the loop point, the end of the selection must match up exactly with the start of the selection - Audacity does not “cheat” (does not do crossfade tricks to make the loop sound better than in really is. This is important if you wish to make looping samples for use in a sampler or in a game or similar applications.

And correct me, but it only works if the selection fits in memory. If it doesn’t, the machine has to smash the physical hard drive armature back and forth and you get serious gaps.


I’ll correct you :wink:
Audacity should be able to play a loop of any length “seamlessly” provided that the start and end of the selection match up exactly. During playback, audio data is read from disk in blocks of just over 1 MB each (remember all those little AU files?). While one block is playing, Audacity will be reading the next one from disk. One of the major benefits of Audacity saving the audio data as “blockfiles” is that it (Audacity) does not need to search through a long file to find the next bit of data to play - it just reads a small file for whatever “next bit” is required.

the selection must match up exactly with the start of Audacity

Time zero? Why does it need to do that? Assuming the waveforms match what’s the difference?


Oops sorry - a bad edit on my part. That should read “the end of the selection must match up exactly with the start of the selection”.
I’ve corrected my previous post.

removed by user

How does Audacity loop play keep the loop seamless?

As above up the thread, Audacity busts the music up into tiny chunks and cleverly juggles the chunks so there is always fresh music in memory at just exactly the right time, and it doesn’t matter where the hole is.

The only requirement is musical, the end and beginning blue waves have to perfectly match.

It’s a common request to want Audacity to force other software to work. The only thing we can do is make a clip with no obvious looping damage. The actual loop is up to them.


In DVD burning land, it’s common to mess up the opening menu which commonly loops a short segment of the movie behind the menu—Play, Select, Language, etc.

It’s stupid simple. You are really playing one massive movie with all the loops perfectly built in. If you stick with it long enough, the DVD player will eventually reset and there will be a big frozen glitch, but nobody ever stays around that long.


removed by user

Are you a developer/programmer and are you comfortable in C++?

I don’t think there is a half-way point and I’m reasonably sure nobody wrote the course on why they did what they did. I know there was a discussion of why they changed from sequential file naming to random, but that’s not going to tell you a whole lot.

Some notes from the Vine publication. They’re forced to work in AAC/MP4 compression because that’s what iOS uses and are completely clear that there is no good way to develop looping given those restrictions, so they admit they use the DVD Movie approach of producing a completed, polished movie with all the loops built-in.

To work around this, Vine virtually renders a video in memory. It can render up to 50 loops, but averages 25 loops with all the trims and crossfades applied.

That low buzzing sound in the background is the bee’s nest of problems with the Audacity Project system. I’m not sure becoming conversant in a structure under fire and that could be on its way out is beneficial.

I think there are developer publications.


removed by user

If I had to guess at it, I’d say Audacity working at super high quality, uncompressed internal format has a lot to do with it. We know from the Vine document that they had a major shortcoming being forced to work with compressed/processed AAC audio. That’s just deadly. We suggest very strongly that you avoid compression while you’re producing your music or shows. Too many people create very good quality original performance work and export it as MP3 instead of WAV, because “that’s what you do.” No it’s not. MP3 is an end product delivery format, not a step in the middle of production.

Audacity works internally at higher than normal bit depths to keep you out of trouble while you’re applying corrections, filters, effects and processing. For example, you might apply a filter that sounds perfect but also causes the show’s volume to increase slightly. Without that bit depth trick, any parts of the performance that go past overload would be lost. With the increased range, you just bring the performance volume back into range (with one of the volume tools) and you’re done.

So right away, Audacity has built-in advantages just not having to struggle with ratty or compressed audio. As we posted multiple times, the hard part is getting the beginning and end waveforms to match so there is no discontinuity, pop, click or tick at the loop point.

I read over parts of that again and I can’t find an eventual goal. Nothing we do here is going to affect your Vine loops. Vine is stuck with iOS audio restrictions.

So what’s the goal?


removed by user

You could probably start looking in src/AudioIO.cpp.


General purpose media player are not usually designed for seamless looping. “Loop play” in such players means “when this track ends, play it again” - there is no continuity between the end of the track and the start of the next playthrough.

Applications that play seamless loops generally do so by reading the start of the next playthrough into a buffer before the current playthrough ends. Windows Media Player probably doesn’t start loading its playback buffers until the start of the track, so when the track ends you then need to wait for the “next track” to start (where the “next track” is the same track again).

Audacity is a “special case” in that it is not just a player and not just a loop player - it is primarily a multi-track editor.

removed by user

What would I have to change in Windows Media Player to make it loop seamlessly as Audacity does?

The program.

I keep cycling over this. It’s generally agreed that most players won’t loop no matter what the content. The only way around this is to send a custom player app along with the song or loop.

Is that what you plan to do?


The source code for this application may also be instructive: GitHub - essej/sooperlooper