Gapless Playback

Audio software developers forum.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Re: Gapless Playback

Permanent link to this post Posted by kozikowski » Sun Jan 22, 2017 1:35 am

http://manual.audacityteam.org/man/auda ... jects.html

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.

Koz
kozikowski
Forum Staff
 
Posts: 36976
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: Gapless Playback

Permanent link to this post Posted by jesalbeta » Sun Jan 22, 2017 4:46 am

kozikowski wrote:
... 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 ...

... so they admit they use the DVD Movie approach of producing a completed, polished movie with all the loops built-in ...



I've taken classes in programming, web apps, and database so I have a decent understanding of the technical aspect/coding. My main concern is trying to avoid the workaround Vine implemented because as you stated above with the DVD intro approach, if you do let a vine loop long enough (the time in order to achieve this freeze glitch is give or take 2 minutes 30 seconds of just letting the vine play), it will pause and rebuffer, like a DVD intro would pause and restart if left alone long enough. The difference with Audacity looping is that you could leave it on loop play 24/7 and it will never pause as it loops (each iteration, forever, will be gapless), which is the sort of true looping I am interested in.

Would you say pre-loading/buffering are the main things to look in to for achieving this type of infinite gapless playback? I'm just sort of at a loss on where to start since there aren't many resources on the topic...
jesalbeta
 
Posts: 6
Joined: Fri Jan 20, 2017 6:18 pm
Operating System: Windows 7

Re: Gapless Playback

Permanent link to this post Posted by kozikowski » Sun Jan 22, 2017 6:13 am

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?

Koz
kozikowski
Forum Staff
 
Posts: 36976
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: Gapless Playback

Permanent link to this post Posted by jesalbeta » Sun Jan 22, 2017 7:11 am

Well I've been making seamless loops on Vine for around 3 years now, so I'm very good at getting the beginning and end waveforms to match so there is no discontinuity at the loop point. I also only work with .wavs so compression shouldn't be an issue either as I understand the limitations of .mp3s. Since Vine ended however, I am planning on creating my own website for gapless playback.

I understand how to make a perfect loop just fine, what I don't understand is how to achieve the gapless playback of that perfect loop.

Let's say I make a perfect loop in Audacity and render the file out as a .wav. Then I open that file in Windows Media Player and set it to loop: it will pause. However if I open the same file back up in Audacity and set it to loop, it will play seamlessly. What would I have to change in Windows Media Player to make it loop seamlessly as Audacity does?

The end goal for my understanding is to be able to bring this sort of infinite gapless playback to the web (eventually for video as well).
jesalbeta
 
Posts: 6
Joined: Fri Jan 20, 2017 6:18 pm
Operating System: Windows 7

Re: Gapless Playback

Permanent link to this post Posted by Gale Andrews » Sun Jan 22, 2017 11:39 am

jesalbeta wrote:
kozikowski wrote:
How does Audacity loop play keep the loop seamless?

... 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 ...


Is there any source code/detailed explanations of this exact process?

http://www.audacityteam.org/download/source/

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


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26092
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Gapless Playback

Permanent link to this post Posted by steve » Sun Jan 22, 2017 12:10 pm

jesalbeta wrote:Then I open that file in Windows Media Player and set it to loop: it will pause. However if I open the same file back up in Audacity and set it to loop, it will play seamlessly. What would I have to change in Windows Media Player to make it loop seamlessly as Audacity does?

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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 43906
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Gapless Playback

Permanent link to this post Posted by jesalbeta » Sun Jan 22, 2017 3:30 pm

steve wrote:Applications that play seamless loops generally do so by reading the start of the next playthrough into a buffer before the current playthrough ends.


I'll start reviewing the Audacity GitHub source code, but if anyone has any other resources on this process, they would be greatly appreciated! My understanding of gapless playback is much clearer (at least on a broader scale), now I have to begin to understand how the coding process works in a more detailed/defined view. Thanks for all your help guys!
jesalbeta
 
Posts: 6
Joined: Fri Jan 20, 2017 6:18 pm
Operating System: Windows 7

Re: Gapless Playback

Permanent link to this post Posted by kozikowski » Mon Jan 23, 2017 1:52 am

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?

Koz
kozikowski
Forum Staff
 
Posts: 36976
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: Gapless Playback

Permanent link to this post Posted by steve » Mon Jan 23, 2017 10:29 am

jesalbeta wrote:... would like to know a little more about gapless playback (perfect looping) is achieved

The source code for this application may also be instructive: https://github.com/essej/sooperlooper
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 43906
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Previous

Return to General Audio Programming



Who is online

Users browsing this forum: No registered users and 2 guests