Opened 3 weeks ago

Last modified 3 weeks ago

#7286 new enhancement

Audiotoolbox: Support decoding Opus and FLAC

Reported by: macdavis Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: Audiotoolbox
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Since MacOS 10.13 / iOS 11, Apple has included "kAudioFormatOpus" ( and "kAudioFormatFLAC" ( into its Audio Data Format Identifiers, which makes it possible to decode those two codecs with Audiotoolbox. Please add this support, thanks!

Attachments (2)

sample_opus.opus (526.9 KB) - added by macdavis 3 weeks ago.
sample_flac.flac (2.3 MB) - added by macdavis 3 weeks ago.

Change History (7)

Changed 3 weeks ago by macdavis

Changed 3 weeks ago by macdavis

comment:1 Changed 3 weeks ago by atomnuker

What's the point when the implementations are likely to be slower than our native ones.

comment:2 Changed 3 weeks ago by macdavis

As tzahola mentioned in,

It actually makes sense, because libFLAC has no public API for getting the compressed audio packets as is. Rice/huffmann/whatever decompression always happens inside libFLAC.

With Apple’s AudioFile? API you can decide whether you want the decompressed PCM samples, or the underlying compressed packets. You can get better energy efficiency if you offload the decompression step to the dedicated coprocessor. The difference is smaller than with hardware vs software h.264 decoding, but there is a difference.

(For lossy codecs this also makes sense when you want to forward the compressed packets to a wireless speaker in order to avoid lossy recompression on Bluetooth transmission.)

comment:3 Changed 3 weeks ago by macdavis

  • Component changed from undetermined to avcodec
  • Keywords Audiotoolbox added
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

comment:4 Changed 3 weeks ago by atomnuker

Yeah, no, that's wrong. I'll believe it when Apple designs and rolls out a hardware decoder for flac, which I really doubt they'll do.
And like the previous post states, the decoder is extremely slow.
Also don't reference HN, its not an accurate and unbiased source of information.

comment:5 Changed 3 weeks ago by cehoyos

  • Priority changed from normal to wish
Note: See TracTickets for help on using tickets.