coqui-ai / STT-examples

🐸STT integration examples
https://github.com/coqui-ai/STT
Mozilla Public License 2.0
117 stars 45 forks source link

Add Django streaming example #34

Closed wasertech closed 2 years ago

wasertech commented 2 years ago

Draft to add a Django example. I need to update the js part of it but it should be a fairly simple example to point to for convenience sake.

wasertech commented 2 years ago
INFO 2022-06-15 20:44:47,546 HTTP/2 support not enabled (install the http2 and tls Twisted extras)
INFO 2022-06-15 20:44:47,549 Using busy-loop synchronous mode on channel layer
INFO 2022-06-15 20:44:47,550 Listening on endpoint tcp:port=8010:interface=127.0.0.1
DEBUG 2022-06-15 20:44:57,390 file name: /tmp/tmp_audiohttp_generated_22-06-15_204457
INFO 2022-06-15 20:44:57,395 Inside stt function
ERROR 2022-06-15 20:44:57,411 exception occurred: WAV header is invalid: nAvgBytesPerSec must equal product of nSamplesPerSec and nBlockAlign, but file has nSamplesPerSec = 16000, nBlockAlign = 2, and nAvgBytesPerSec = 64000

I'm currently struggling with this check in scipy which assert the header of the wav file.

Either the js recorder or the resampler must be fixed to account for this check.

Edit: It was the wav encoder.

wasertech commented 2 years ago

image

wasertech commented 2 years ago

Be default in chromium, you can't get access to media devices (mic) over an unsecured connection (http) but it should work just fine with encryption. See https://stackoverflow.com/questions/34165614/navigator-mediadevices-getusermedia-is-not-working-and-neither-does-webkitgetuse

Websocket channel is known to be finicky but it should work with the enforced version.

wasertech commented 2 years ago

I also fixed the header of the recorded wav files. (I did it in local) image