Post by funkslovechild on Sept 14, 2021 5:13:19 GMT -5
I did try recoding the same files again from FLAC but at cvbr bitrate instead of tvbr and also with smart padding off which the QAAC encoder uses but still was a small glitch between the tracks. Also i tried with OPUS format and gapless playback was flawless between the two files.
im not familiar with QAAC but aac is a fixed frame size format so the encoder needs to correctly add gapless metadata (how much garbage data is at the beginning / end that needs to be skipped) to the files in order to achieve gapless playback. opus/vorbis are variable frame size so they naturally are gapless. My guess what be QAAC is not quite following the standards on that metadata. Due to patents, gmmp does not include its own AAC decoder (uses one built into the android apis).. so it has to handle gapless itself based off this metadata. Poweramp lets ffmpeg handle all decoding (id guess blackplayer does too) since the dev isnt based in the US he didnt have to worry about it. ffmpeg handles gapless better (meaning it supports multiple ways of adding the gapless metadata).
GMMP's next gen audioengine that im working on here and there on the side will be 100% ffmpeg decoding since the aac decoding patents will have expired by then (if they havent already)
Post by funkslovechild on Sept 14, 2021 13:19:00 GMT -5
Looking at the QAAC encoding page there are three modes for gapless and by default it uses the first one. I might try the other modes to see if it makes a difference or just use OPUS.
--gapless-mode Specifies how to describe the amount of delay/padding in the M4A container.
0(default) iTunSMPB 1 ISO standard 2 Both iTunSMPB is a special tag describing amount of delay and padding, used by iTunes, Nero, and FhG encoders.
ISO standard way instead uses MP4 boxes such as elst(Edit List), sbgp(Sample to Group), and sgpd(Sample Group Description).
Basically, non-standard iTunSMPB is common among music players such as foobar2000 or rockbox. However, since it is written as a file global tag, it is not suited for multiplexing into MP4 files containing multiple tracks.
Post by funkslovechild on Sept 15, 2021 3:59:32 GMT -5
Guessing maybe it could be something to do with the AAC decoder built on my Samsung Galaxy S10 but im sure Blackplayer uses the phones built in decoder and that plays the same files without any glitches.
built in decoder api isnt the same as the built in mediaplayer api. If blackplayer doesnt have its own custom audioengine it would be using the android mediaplayer api which uses something completely different from the decoder apis. The audio apis on android in general are a fragmented mess.
but yea like i said i'll take a look at the actual files playing in gmmp sometime before the next update. The tags at least for the 2nd file you sent looked correct (format wise at least so gmmp should be able to read it). I didnt check the first one. Gapless requires both files have the correct tags
alright so i got around to checking this out and i honestly have no idea what the issue is. The gapless data is read correctly from the itunsmpb tag and the correct amount of data is removed from the start and end. I also swapped over to try using ffmpeg as the decoder and that produced an ever bigger gap. It must be something specific about that encoder. From what i've read some encoders dont correctly add enough samples at the end.. but there really isnt anything i could find online that would indicate that im doing something incorrectly. If you know of any open source audio player (the engine being open source) that handles those files correctly, let me know and i can check out what they are doing differently
Last Edit: Sept 29, 2021 22:28:50 GMT -5 by GoneMAD