INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Gapless Playback with AAC files  (Read 10473 times)

WuTofu

  • Recent member
  • *
  • Posts: 5
Gapless Playback with AAC files
« on: July 03, 2011, 07:23:30 pm »

I'm having some trouble with playing files with gapless playback, specifically AAC files. I know that I have gapless playback set correctly because I can successfully playback tracks without any gaps from other file types (like ALAC, FLAC, etc.)

I also know that it isn't the files themselves, because I can play them back gaplessly from foobar. Can anyone help?
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Gapless Playback with AAC files
« Reply #1 on: July 04, 2011, 05:46:30 pm »

Gapless decoding for AAC in MP4 container (.m4a) has not been implemented (yet?).

I reguested it when the new decoder plug-in was under development:

http://yabb.jriver.com/interact/index.php?topic=63215

... Missing functionality

- Gapless m4a/AAC playback. I'd expect native support include gapless playback.

iTunes and the recent versions of the Nero encoder store the gapless playback info in the ITUNSMPB tag. The values are stored in hex format as follows (in this example: Nero LC, HE and HE+PS):

Red=encoder delay  Green=padding   Blue=original sample count
Quote
LC
 00000000 00000A40 000003E4 000000000004B5DC 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

HE
 00000000 00000920 000003F2 0000000000025AEE 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

HE+PS
 00000000 00000AF8 0000021A 0000000000025AEE 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Here are the values after conversion to dec:

LC
2624    996   308700

HE
2336   1010   154350

HE+PS
2808    538   154350

Apparently the original sample count for the HE versions is correct for the LC part (half of the reconstructed sample rate).

In addition you must also take the decoder delay into account. Here is a related thread at doom9: http://forum.doom9.org/showthread.php?t=154881

I hope it is on the developers' to-do list.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

WuTofu

  • Recent member
  • *
  • Posts: 5
Re: Gapless Playback with AAC files
« Reply #2 on: July 04, 2011, 11:38:17 pm »

Oh, alright. Thanks for letting me know!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Gapless Playback with AAC files
« Reply #3 on: July 05, 2011, 09:18:20 am »

Gapless AAC is on the the to-do list.
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Gapless Playback with AAC files
« Reply #4 on: July 06, 2011, 09:59:39 am »

Coming in 16.0.126 (and newer):
NEW: Added support for gapless AAC playback (requires iTunSMPB header).

It sounds perfect with Alex's LC-AAC test files. 

It doesn't sound perfect with some of the HE-AAC test files, and I'm not sure if this is due to the files or some other issue.  So testing (and sample files if there's an issue) would be appreciated.

Thanks.
Logged
Matt Ashland, JRiver Media Center

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Gapless Playback with AAC files
« Reply #5 on: July 20, 2011, 02:12:49 pm »

... It doesn't sound perfect with some of the HE-AAC test files, and I'm not sure if this is due to the files or some other issue. ...

I have not had time to test this earlier (I am doing it now), but are the HE-files that do not play gaplessly from my "iTunes HE-AAC" set?

If you revisited the thread and reply in which I provided the samples you may have missed the following later post in the same thread:

FYI, I just noticed that the ITUNSMPB tag values in my "iTunes HE-AAC (SBR)" sample files are slightly off. This is caused by a buggy iTunes version (an early v.10 build).

I just installed the latest iTunes version (10.2.1.1) and the bug seems to be fixed. It produces values that are identical to the Nero and QuickTime values.

For encoding the "QuickTime LC-AAC" set I used the qaac frontend and it created correct ITUNSMPB tags.

So, if you are considering adding gapless support, do not use the "iTunes HE-AAC (SBR)" file set for testing the behavior.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Gapless Playback with AAC files
« Reply #6 on: July 20, 2011, 02:31:59 pm »

Seems like also the Nero HE-AAC samples do not play gaplessly.

Apparently the original sample count for the HE versions is correct for the LC part (half of the reconstructed sample rate).

I wonder if this is true also for the other values.

In my example the correct values for the decoded 44.1 kHz output would then be:

HE
2 x 2336   2 x 1010   2 x 154350

HE+PS
2 x 2808    2 x 538   2 x 154350
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Gapless Playback with AAC files
« Reply #7 on: July 20, 2011, 03:25:51 pm »

I may be right. I created a set of "fixed" sample files. I simply doubled the encoder delay and padding values in the  ITUNSMPB tag (in Hex format, of course). It seems to do the trick.

The edited samples are attached.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Gapless Playback with AAC files
« Reply #8 on: July 20, 2011, 03:29:47 pm »

Nice detective work.

Next build:
Fixed: Gapless playback of HC-AAC files was not working properly.
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up