question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can FLAC Extension play 96kHz/24bit track without downsampling?

See original GitHub issue

I’m using FLAC Extension to play .flac files and I have really basic ExoPlayer setup:

ExoPlayer exoPlayer = new SimpleExoPlayer.Builder(this).build();

public void playUrl(String url) {
            MediaSource mediaSource = new ProgressiveMediaSource.Factory(new DefaultDataSourceFactory(this, agent))
                    .createMediaSource(Uri.parse(url));
            exoPlayer.prepare(mediaSource);
            exoPlayer.setPlayWhenReady(true);
    }

.flac files are playing ok, but when I look at the audio output it shows that audio signal can’t go above the 24kHz, it always gets downsampled. For testing purposes I have a 96kHz/24bit .flac file that is just simple audio signal that goes from 1kHz to 32kHz and I’m checking audio output with Audacity. And what I’m seeing is that signal never goes above 24kHz. Is this a bug in the ExoPlayer library since there is a commit that states that 192kHz should be supported: https://github.com/google/ExoPlayer/commit/0b0868889ec3caaa64579d0f3212229fc987a304? Does that mean that ExoPlayer downsamples everything that goes above 48kHz? Am I missing something here to support 96kHz?

Also, I’ve performed same test using Android MediaPlayer and it’s ok, signal goes to 32kHz without any issues.

EDIT: ExoPlayer version: current dev-v2 version, with latest commit: https://github.com/google/ExoPlayer/commit/87003b30fce2860dc734025b00fcf06de8da4ded (I couldn’t build FLAC extension with the latest release version release-v2 ). Previously I’ve used ExoPlayer v2.10.1 and it had the same issue Testing device: Sony Xperia XZ Other Audio equipment: external USB sound card (Steinberg UR28) to test output of analog (via on-device 3.5mm stereo jack) and digital audio signal (via USB audio through Steinberg UR28)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
krocardcommented, Dec 4, 2019

Note that outputting audio at 96kHz on an analog jack is probably not very compatible with cheap earphones. Speakers (especially cheap ones) are not design to handle such high frequencies (>24kHz) and they might produce unwanted non linearities in the audible frequency range (<20kHz). As a result playing > 24kHz on an analog output may diminish the sound quality instead of improving it. That is one of the reason most phone only support 24kHz (48kHz SR) on their analog output. So it is not surprising you only found support in a few flagship.

0reactions
ivan2311commented, Dec 11, 2019

Thanks again @krocard !

Read more comments on GitHub >

github_iconTop Results From Across the Web

24 Bit 96/192 kHz Flac Player That Doesn't Down Sample?
Is it even possible to play 24 bit flac files without down sampling and if it is possible, which player would work? :confused:...
Read more >
Help understanding downsampling of "fake" high-res files
Neither upsampling nor downsampling is lossless - you won't get bit-to-bit the same file after upsampling and then downsampling back (except for ...
Read more >
Airplay & downsampling - Apple Support Communities
It is my understanding that itunes can play 24/96 files since it can correctly indentify and read them (ALAC files, not FLAC files)....
Read more >
Best and most streamline way of converting 24/96 FLAC to ...
Touch's can play hi-rez FLAC files using the FLAC Player app. They will automatically downsample to 16/48 during playback, but no conversion is ......
Read more >
How to tell if a high-res flac file has been upsampled from a ...
Only problem: it does not support high-res files. It is stated clearly on the website that it can only work with CD-quality files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found