Closed tdcook closed 5 months ago
Ngl, I never encounter this issue when testing (where I reload a zillion times). What browser are you using?
Thanks for pointing this out, I'll fix it ASAP!
I have tried Chrome and Firefox, all on a Linux machine with a USB microphone attached. I suspect it only crops up on certain systems.
Can you try unplugging the USB microphone, if you are encountering issue from the microphone recognition? Or is it just straight from startup, not doing anything yet?
It happens right on startup, before any recognition starts. I have only seen it happen there, never after a successful startup.
This path of code is quite hot, can you try unplugging the USB microphone to see? I tried many times to see if it would pop up, but it wouldn't. Can you try if the USB microphone was the problem? Maybe it messed with the AudioContext?
Well, if I remove the USB microphone from that machine, I won't have any microphone input to use. Instead I tested it on two laptops using their built-in microphones:
Framework Laptop 16 (Fedora Linux 40): Firefox 126 repros inconsistently. Chrome 125 repros more consistently but occasionally works.
Surface Pro 4 (Windows 10): Firefox 126 repros inconsistently. Edge reproed once on the very first try but never reproed again.
According to the spec the inputs array for a source can be empty if the source node is not "actively processing". Perhaps there is, on some OS/browser combinations, a moment after initialization where the microphone stream node is not actively processing.
@tdcook Can you recheck (latest commit on main)?
Looks good, thanks!
Sometimes,
VoskletTransferer
will throw aTypeError: cannot convert undefined to object
exception immediately after initialization. It won't always happen right away, but usually will after a few reloads. It seems there is a race condition between the connection of the source and processor nodes and the execution ofVoskletTransferer
'sprocess
method.The error is being thrown here:
https://github.com/msqr1/Vosklet/blob/76aedbdfee862de8a734a3a4f09ffb82eeaf50da/src/wrapper.js#L11
Adding a falsiness check here should fix it: