Open glynnbird opened 4 years ago
OK, here's my thinking:
In our getUserMedia constraints we can pass a desired latency target. While the stream will be unlikely to achieve the exact latency we ask for, the browser will do its best to achieve that and will report it with stream.getAudioTracks()[0].getSettings().latency
.
Except sometimes it doesn't. While Chrome (on macOS, at least) will return what the latency is using the above line of code, it seems Firefox ignores the constraint completely (which this Bugzilla ticket would suggest is the case). When Chrome returns the reported latency, however, my tests show it to be more accurate than our current client-side offset_analyser.
So, here's what I suggest we implement in our code.
What do you think to that?
Sounds good to me
On Sun, 12 Jul 2020, 18:17 Sean M. Tracey, notifications@github.com wrote:
Reopened #62 https://github.com/Choirless/Application-Server/issues/62.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Choirless/Application-Server/issues/62#event-3537278987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFKMRKZQJHXUMJBBKFQULTR3HVZ5ANCNFSM4OX2KM7Q .
The "offset" - the time correction required to align the second recorded part with the leader is pretty much a constant. Here's some experimental data:
Applying an offset of zero is pretty disastrous for the use-case where completely different parts are being recorded e.g. a garage band. The Librosa-offset calculator can't hope to help matching a piano to a drum machine
I propose that once a valid offset is recorded, it is stored in the browser's local storage we then have two choices: