Identify Dolby audio tracks in a AVAssetMediaSelectionGroup

In order to provide to our users more information about the different audio tracks available in our streams, I am trying to identify Dolby audio tracks from the AVAssetMediaSelectionGroup that I get from the asset.

To do that, I am trying to get the audio codec from each AVMediaSelectionKeyValueOption. That way, from the codec, I could identify this track as Dolby, Stereo, etc...

Sadly, I did not find this information available in AVMediaSelectionKeyValueOption. Is there some way that I could use to get this data?

For the log, this is I am currently able to get from each media selection:

(lldb) po playerItem.asset.mediaSelectionGroup(forMediaCharacteristic: .audible)

▿ Optional<AVMediaSelectionGroup>

  - some : <AVAssetMediaSelectionGroup: 0x28306fa00, options = (

    "<AVMediaSelectionKeyValueOption: 0x28306d480, language = en, mediaType = 'soun', title = English, default = YES>",

    "<AVMediaSelectionKeyValueOption: 0x28306d380, language = nar, mediaType = 'soun', title = Other (nar)>"

), allowsEmptySelection = YES>

Have you tried looking at the mediaSubTypes property?

I have just checked the values from the mediaSubTypes property. Sadly all that I got are a couple of empty arrays.

(lldb) po playerItem.asset.mediaSelectionGroup(forMediaCharacteristic: .audible)?.options.map { $0.mediaSubTypes }

▿ Optional<Array<Array<NSNumber>>>

  ▿ some : 2 elements

    - 0 : 0 elements

    - 1 : 0 elements

(lldb) 
Identify Dolby audio tracks in a AVAssetMediaSelectionGroup
 
 
Q