Hello,
Here an issue where I am not sure, if it is related to BASS or to macOS Versions, since BASS uses the OS's AAC codec on macOS.
AAC encodes in overlapping frames of 1024 samples. For that reason encoders typically encode 2112 silent samples before the actual audio begins. This is called AAC priming, and the number of extra samples is written to the MP4 stream.
I created ACC encoded m4a audio files using Apple's afconvert that comes with the OS. (For anybody trying to do so, note that you need to set afconvert's options --gapless-before and --gapless-after to really obtain gapless playback.)
Decoding theses files with BASS_StreamCreateFile() and BASS_ChannelGetData() results to the following strange behaviour:
On macOS 12.6.1 (x86_64) and macOS 10.13.6 (x86_64) everything works as it should be. BASS_ChannelGetData() delivers samples from the actual start of the audio and I can play back multiple files without audio gaps.
But, on macOS 13.5 (arm64), BASS_ChannelGetData() delivers the 2112 priming samples first, causing a silent gap. Moreover the total number of delivered samples is correct, so at the end of the stream there are 2112 audio samples missing. Decoding the same files on that machine using afconvert, Music.app or AVQueuePlayer from AVFoundation framework does not result in audio gaps.
Do you do anything different in BASS depending on macOS and/or intel/arm that could explain this behaviour?
Thanks again, Klaus