Poor audio quality on certain files, works fine in the VLC app
Summary
I have a rather bizarre issue that I stumbled across with libvlcsharp on Android. When I go to play some audio files, I noticed that the audio quality can be very poor BUT it works perfectly fine in the VLC application on Android.
This only happens on certain files. I have attached a sample flac file that has the issue. It sounds tinny (pay special attention to the piano, but the overall sound is bad compared to running it in the VLC app in the Google Play store).
Minimal project and steps to reproduce
- Download the sample flac file on the ticket, put it in a directory and serve the directory up with python ("python3 -m http.server")
- Download libvlcsharp-samples repo (I've been testing with the MediaElement project for Android).
- In MainViewModel.cs, change the Media() constructor to download from the python3 server:
new Media(LibVLC, "http://192.168.1.2/sample.flac", FromType.FromLocation)
I also bumped the target framework up to "Android 9.0 (Pie)"
- Deploy the built app to your Android phone. Run the app.
- Listen to the quality of the audio, pay particular attention to the piano as it sounds the most tinny.
- Go to the VLC app from the Google Play store. Stream from the same Python 3 server that was set up in step 1.
- Listen to the quality difference, it sounds much better in the VLC app, not tinny at all.
What is the current bug behavior?
The audio quality sounds poor and tinny
What is the expected correct behavior?
The audio is supposed to sound great and high quality since its a lossless flac
Does it work on other plaforms? Does it work with the official VLC apps?
It works fine on the official VLC app from the Google Play Store.
The issue might be related to it running on a physical device, as my sound is very choppy on the Android emulator because my computer is too slow. I am running it on a Pixel 3 XL and can provide logs if needed.
I also recommend headphones instead of using the phone speakers to hear the difference since phone speakers are abysmal.
Relevant logs and/or screenshots
Environment
- OS: Android
- Version: 10
- Device: Pixel 3 XL
- LibVLC version and architecture 3.2.0 for ARM (latest)
- LibVLCSharp version 3.4.3 (latest)