Opened 3 years ago

Last modified 3 years 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 3 years ago.
sample_flac.flac (2.3 MB ) - added by macdavis 3 years ago.

Change History (7)

by macdavis, 3 years ago

Attachment: sample_opus.opus added

by macdavis, 3 years ago

Attachment: sample_flac.flac added

comment:1 by Rostislav Pehlivanov, 3 years ago

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

comment:2 by macdavis, 3 years ago

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 by macdavis, 3 years ago

Component: undeterminedavcodec
Keywords: Audiotoolbox added
Type: defectenhancement
Version: unspecifiedgit-master

comment:4 by Rostislav Pehlivanov, 3 years ago

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 by Carl Eugen Hoyos, 3 years ago

Priority: normalwish
Note: See TracTickets for help on using tickets.