Opened 6 months ago

Last modified 6 months 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

Description

Since MacOS 10.13 / iOS 11, Apple has included "kAudioFormatOpus" (https://developer.apple.com/documentation/coreaudio/1572096-audio_data_format_identifiers/kaudioformatopus?language=objc) and "kAudioFormatFLAC" (https://developer.apple.com/documentation/coreaudio/1572096-audio_data_format_identifiers/kaudioformatflac?language=objc) 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 6 months ago.
sample_flac.flac (2.3 MB) - added by macdavis 6 months ago.

Change History (7)

Changed 6 months ago by macdavis

Changed 6 months ago by macdavis

comment:1 Changed 6 months ago by atomnuker

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

comment:2 Changed 6 months ago by macdavis

As tzahola mentioned in https://news.ycombinator.com/item?id=16320721,

"
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 6 months 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 6 months 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 6 months ago by cehoyos

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