No more gaps between tracks? Only with Airtunes

Posted:
in iPod + iTunes + AppleTV edited January 2014
I have been using my Airport Express and decent speakers in my dorm room this term to stream music and recently I have noticed something: there seemed to be no gaps between songs. I put on Linkin Park's Meteora (if you've heard it, you'll know how obvious the gap between tracks 1 and 2 is) and sure enough there was no gap between the tracks.



When I played through the PowerBook's speakers, the gap was there in an all too obvious way.



Was this always the case with Airtunes, or has this been a fix with the Airport Express/iTunes updates. You have to wonder why this can't be done through the normal speakers though...

Comments

  • Reply 1 of 11
    kickahakickaha Posts: 8,760member
    As I understand it, the gap between tracks is an artifact of MP3 compression (no, I don't know why either, but that was what I was told, just bear with me a moment). Crossfading works, but gapless doesn't easily (although a crossfade of 0sec would do it, you'd think... *shrug*). AAC doesn't have this limitation, apparently, but since it doesn't work with MP3s, they don't try it with AAC. (Look, I said it sounded hokey, but hold on a minute.)



    Playback on your local machine uses the native codec, but playing back on an *AirPort* is using Apple Lossless. The sound is compressed by iTunes into AL, sent to the AirPort, and then unencrypted and played. Now, *if* the above rationale for no gapless playback is true, that it relies on the codec, this would make sense, since it's using a completely different codec.



    Just a possibility, one that I can neither confirm nor deny.
  • Reply 2 of 11
    I didn't realise it encoded to Apple Lossless; that would explain why my out bandwidth when playing music is so much...
  • Reply 3 of 11
    keotkeot Posts: 116member
    It doesn't sound gapless to me, but it's almost there.



    I'm playing a 160kb/s AAC file at the moment which appears to be transformed into a ~90kB/s (720kb/s) stream to the AirPort Express which would indeed suggest that iTunes is converting everything to Apple Lossless before sending it.



    MP3's can never be truely lossless because they're encoded into frames. For a standard 128kb/s MP3 file each frame is approximately* 0.026s long. The audio length is rounded up to complete frames, so every MP3 out there has a slight bit of silence at the end.



    * I may have calculated it badly...
  • Reply 4 of 11
    shetlineshetline Posts: 4,695member
    Quote:

    Originally posted by Kickaha

    As I understand it, the gap between tracks is an artifact of MP3 compression... AAC doesn't have this limitation...



    Both MP3 and AAC have problems with gapless playback, and for pretty much the same technical reasons: compression is done in both cases using "frames" of fixed duration, and both formats apply "lead-in" and "lead-out" padding to facilitate encoding.



    There are also, for both formats as well, format extensions for implementing gapless playback. The problem is those extensions aren't widely implemented in either players or decoders yet.



    Applelossless should be utterly capable of gapless playback, at a format level, but Apple doesn't seem to have bothered setting up the necessary audio buffer timing to get gapless playback from Lossless.
  • Reply 5 of 11
    the "gaplessness" seems close enough for me...
  • Reply 6 of 11
    dglowdglow Posts: 147member
    This topics interests me and has for some time. Lately I've been playing with the new AirTunes output options in iTunes 6.0.2. Here's what I found:



    Presence of Gaps in iTunes Playback



    Legend:

    vertical axis: Music Format

    horizontal axis: Playback Method



    Code:




    ComputerAirtunesComputer + Airtunes*



    AppleGAPSGAPLESSGAPLESS

    Lossless



    AACGAPSGAPLESSGAPLESS

    160 VBR



    MP3GAPSSTUTTER**STUTTER**

    160 VBR







    * via 'Multiple Speakers' option introduced in iTunes 6.0.2



    ** STUTTER means that a very brief glitch in playback is detectable, the nature of which is qualitatively distinct from a 'GAP', where a GAP is characterized by a short moment of silence between tracks





    Source Material: Dark Side of the Moon tracks 1 & 2 (Speak to Me > Breathe In The Air)



    Listening Methods:

    1) Computer: iTunes > PowerBook headphone jack > Etymotic Earbuds

    2) AirTunes: iTunes > WiFi > Airport Express > Headphone Amp > Etymotic Earbuds





    Observations:

    - (lossy) compressed audio can be played back gap-free (though AAC excels over MP3)

    - airtunes playback is always gapless

    - computer playback can be gapless, but only when also streaming to AirTunes



    Conclusions:

    - gapless playback is dependent on playback method, not audio format

    - therefore: gapless playback has always been possible

    - therefore: Apple's party-line explaining the presence of gaps has been BS (or at least disingenuous)



    EDIT: fixed typos
  • Reply 7 of 11
    Quote:

    Originally posted by dglow

    gapless playback is dependent on playback method, not audio format



    From the above, I would say it has to do with both audio format and the implementation. From what I read above regarding frames, it makes sense as to why AAC & MP3 can't achieve gapless playback. From Apple's point of view they can put gapless technology into the AE, because they know that the content they receive will be Lossloess encoded.



    At any rate there is a way to playback gapless through iTunes and with AAC files. I'd imagine an algorithm to find the last piece of audio on one track and the first on the next and play them at times accordingly, to achieve gapless playback. Albeit a somewhat hack around way.
  • Reply 8 of 11
    brussellbrussell Posts: 9,812member
    Thanks for that dglow. Nice work.
  • Reply 9 of 11
    dglowdglow Posts: 147member
    You're welcome, BRussell.



    Quote:

    Originally posted by danielctull

    From the above, I would say it has to do with both audio format and the implementation. From what I read above regarding frames, it makes sense as to why AAC & MP3 can't achieve gapless playback. From Apple's point of view they can put gapless technology into the AE, because they know that the content they receive will be Lossloess encoded.



    Agree that it has to do with the implementation... but the implementation of what, exactly? From the listening I've done, it appears the presence of gaps has nothing to do with the audio format - it's all iTunes. The lossless encoding AirTunes performs does not remove the 'frame issue' if the source material is compressed with a lossy codec.



    Think about it: with a minor software update Apple introduced gapless playback directly from iTunes! Suddenly the computer's line out, which has never played gapless before, will play gapless when also streaming to an Airport Express.



    So we can't really say Apple "[only] put gapless technology into AE" , because that same behavior is now available directly from the computer's audio out. It seems the gaps have *always* been a failing of Apple's iTunes implementation.



    This begs the obvious questions:

    1. Why can't iTunes play gaplessly all the time?

    2. If Apple can fix it for iTunes, could they fix it for iPods? Please?
  • Reply 10 of 11
    dcqdcq Posts: 349member
    Quote:

    Originally posted by danielctull

    I didn't realise it encoded to Apple Lossless; that would explain why my out bandwidth when playing music is so much...



    It encodes your compressed file into AL, then the Airport Express decodes it before playing. This makes the file smaller than it would be if it just sent the mp3/aac over the air.
  • Reply 11 of 11
    dglowdglow Posts: 147member
    Quote:

    Originally posted by DCQ

    It encodes your compressed file into AL, then the Airport Express decodes it before playing. This makes the file smaller than it would be if it just sent the mp3/aac over the air.



    It actually results in more data over the air.

    Apple Lossless = 600-1000 kbps; MP3/AAC = 128-256 kbps
Sign In or Register to comment.