web-audio-recording-tests
web-audio-recording-tests copied to clipboard
Disruption in audio on Android browsers when encoding is enabled
Hi there,
Thank you for this awesome repo, you have done a great job, I'm using this repo from quite a long time and it's working perfectly, however, there is an issue in "Test-6 In Browser Encoding", when I record and play audio in the Android browser (Chrome I have tested), there is a disruption in the audio and this is there for all three encoders in Test6 demo. Please look into this once or suggest me any alternative for this, I want to record audio in .wav format.
I'm glad you've found this repo helpful. Regarding your issue, I just tested with a Google Pixel 2 (Android 9 / Chrome 75.x), and I had no issues with Test 6. The audio/wav option was selected, and I used the default mic on the phone without anything connected. So, I believe your problem is likely hardware/phone/environment specific.
-
What device and Android version are you running?
-
Do you have anything external connected (wired or bluetooth)?
-
Did you reboot phone at some point and retest? Are you able to replicate on a different Android device?
-
Have you done anything that might cause the inbound recording data format to be stereo, instead of mono?
- That is something I don't think Test 6 handles. You can check if the inbound recording is stereo by using the menu to look at "Diagnostics". On my device, under "Default capabilities, constraints, & settings", I see
track[0].settings[channelCount] : 1
.
- That is something I don't think Test 6 handles. You can check if the inbound recording is stereo by using the menu to look at "Diagnostics". On my device, under "Default capabilities, constraints, & settings", I see
Test 6 uses web workers, and is likely the only test here to do so on Android devices with Chrome. If you've ruled other options out, then my first guess would be something to do with web workers (especially if all the other tests work fine). To see if the issue is related to the web worker, I would've suggested using this demo by Higuma, however, it does not work on Android/Chrome. Still, the underlying code might be of use to you if you need to explore this further.
Thank you for your response,
- I'm running this test on Oneplus6 A600(Android9 / chrome 75.x).
- I have tested it with or without anything external connected (wired or Bluetooth) and the same problem persists.
- I did a reboot and retested it, but the disruption was still there, other than oneplus6, tested on Asus-X00TD, RealMe 3 RMX 1851, both have (Android 9 / Chrome 75.x), also tested on google pixel 3 and it worked perfectly.
- here is a screenshot of my oneplus6 browser diagnostic test: https://filebin.net/9x7x26cibfiygfpb/1562833522522.JPEG
- here is the audio file I have recorded with oneplus6: https://filebin.net/9x7x26cibfiygfpb/5eed8e36-1f37-4418-b2a7-27345074352a.wav
Please take a look, meanwhile, I will go through the code written by Higuma
You only get this issue when using "Test 6" on the OnePlus 6, and you do not hear the issue with the other tests on the OnePlus 6, such as Test 1. Correct?
On Test 1, does enabling/disabling the echo cancellation make any difference?
A quick google search indicates there were issues with the microphone handling on OnePlus 6 at some point:
- https://www.androidpolice.com/2019/01/30/oneplus-6-and-6t-wrecking-audio-quality-by-using-the-wrong-mic-in-some-apps-like-snapchat-and-whatsapp/
However, if that was related, it's not obvious how it could be an issue only with Test 6.
Other Tests works fine on all the phones including oneplus6, also enabling/disabling echo cancellation in Test 1 does not make any difference on the oneplus6 as well as Asus and Realme 3, also I'm not using any external microphone. This works perfectly for iPhones and Google pixel series. I recently tried it on Redmi Note 5 pro and another Asus phone and the same issue is still there.
Also, Test 6 does encoding while recording, Is there any way where I can do encoding after recording is done?