google / google/ExoPlayer

Incorrect audioFormat data

Open
#11,055 4 comments 0 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Hi. I need to retrieve infrormation from currently playing audio stream. I get It like this :
`val format = exoPlayer.audioFormat`
`val sampleRate = format?.sampleRate ?: 0`
`val channels = format?.channelCount ?: 0`

For some streams (maybe most part) it is correct.
Sometimes though it says 22050, 1 channel, when in fact it is 44100 and 2 channels.
In other cases when it says 24000 2 channels, in fact it is 48000 2 channels
When it is incorrect, it is consistent for particular streams.

Is there another way to determine this information of format inside exoplayer, or am I doing it wrong?

**ALSO**
Seems, when format sampleMimeType is audio/mp4a-latm, it is usually incorrect.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.