Can FLAC Extension play 96kHz/24bit track without downsampling?
See original GitHub issueI’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:
- Created 4 years ago
- Reactions:1
- Comments:19 (10 by maintainers)
Top GitHub Comments
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.
Thanks again @krocard !