Closed slime73 closed 2 years ago
Original comment by Miku AuahDark (Bitbucket: AuahDark, ).
My device is Mi A1 (stock ROM Android 9) and I can confirm it works. You may want to check this forum posts for more information: https://love2d.org/forums/viewtopic.php?f=4&t=88151&p=231799#p231799
The linked method of searching for correct recording parameters works for me. The buffer length is especially sensitive. On Pixel 2 I can record in mono with 48000 sample rate and 16 bit depth, and buffer length of 16384 is the only one accepted.
When using the getData() to collect multiple recordings and join them, I can record longer lengths of sound, but there is a glitch in joined recording. I could also reproduce same glitch with code provided on forum, across two phones. The glitch sounds as if one buffer is dropped. It always occurs around 0.4 seconds from start of recording, which should be on collected buffer number 8. On desktop the glitch is not reproducible. Any idea how to fix it?
Also, I think Love2D documentation incorrectly states that ring buffer is used for recording and that new data overwrites old data. In all my experiments with single buffer recording (without getData) the resulting recording contains only beginning of recorded sound and everything after buffer is filled is lost.
but there is a glitch in joined recording. I could also reproduce same glitch with code provided on forum, across two phones. The glitch sounds as if one buffer is dropped. It always occurs around 0.4 seconds from start of recording, which should be on collected buffer number 8.
Can you provide minimal main.lua which reproduces the issue?
While I was testing the new OpenAL-soft update, I can reproduce the "glitch" issue. However I'm not sure if it's LOVE, OpenAL-soft, or even OpenSLES fault.
In my app (source here) I implemented a workaround for this.
I start recording in advance and discard samples in background. Only when user presses and holds the MIC button are the samples actually captured. This works without the mentioned glitch, but with a different downside. It's not possible to sync the rolling buffer with button press. This means the captured sound will often have samples from even before the button was pressed.
I'd see if I can find and compile a recording example program from OpenAL-soft. If it turns out to have issues too, then I'd report it to OpenAL-soft instead.
I ended up reporting the problems to upstream: kcat/openal-soft#517
Thank you for your effort!
Fixed in LOVE 12.0. efbf3f5500008d46d965e3003ea62a04e450cd53 love2d/megasource@b9964119f5af9942590328076b75830f3e6adb22.
Original report by Igor Gvaldov (Bitbucket: [Игорь Гвалдов](https://bitbucket.org/Игорь Гвалдов), ).
RecordingDevice:start() always returns false (Microphone permission granted).
Phone: Mi A1
Firmware: LOS 16.0 (Android 9)
Love2D version: 11.3 (APK file downloaded from the main repo)
What am I doing wrong?