alumae / kaldi-gstreamer-server

Real-time full-duplex speech recognition server, based on the Kaldi toolkit and the GStreamer framwork.
BSD 2-Clause "Simplified" License
1.07k stars 341 forks source link

Audio capture problem #69

Closed bchinnari closed 7 years ago

bchinnari commented 7 years ago

Hi all

We have configured kaldi gstreamer as per the instructions. We are using kaljurand client package (as mentioned in your readme.md). After this whole setup, when we are trying to record the audio...server/worker is getting request from the client but the raw data which is stored in the tmp folder is empty (0 bytes) and the opened session is idle forever . Kindly let me know where it can go wrong.

Thanks Bhargav

alumae commented 7 years ago

Are you using HTTPS? Newer Chrome versions don't allow recording audio if the page is served over HTTP.

bchinnari commented 7 years ago

We are using firefox.

var SERVER = "ws://localhost:8888/client/ws/speech"; var SERVER_STATUS = "ws://localhost:8888/client/ws/status"; var REFERENCE_HANDLER = "ws://localhost:8888/client/dynamic/reference";

We are using above details in dictate.js and demo.js

alumae commented 7 years ago

Is there anything printed to the Firefox Javascript console? Try alos with Chrome and check the JS console.

bchinnari commented 7 years ago

Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead[Learn More] jquery-1.10.2.min.js:1 navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMedia dictate.js:113:4 SecurityError: Failed to load worker script at "/home/aai/Downloads/Kaljurand-dictate.js-7efd3b1/lib/recorderWorker.js" (unknown) Use of getPreventDefault() is deprecated. Use defaultPrevented instead. demo.html

This is the console log we are getting.

alumae commented 7 years ago

Does it work with Chrome?

bchinnari commented 7 years ago

No. Same error. We checked the path /home/aai/Downloads/Kaljurand-dictate.js-7efd3b1/lib/recorderWorker.js also. This is the correct path.

bchinnari commented 7 years ago

Hi Tanel,

Finally, it worked after after launching chrome as follows "google-chrome --allow-file-access-from-files" and then opening demo.html cleared the error.

It is a very cool project you developed and working with minimal latency.
Thank you so much for patiently answering the queries. Also, I would like to know more how this is working internally. I would appreciate if you throw some light on this.

bchinnari commented 7 years ago

Hi Tanel,

I have a small question. In the current configuration, we can pre-define number of workers we want to run. Is it possible to launch and close a worker when a new status listener comes and leaves?

alumae commented 7 years ago

No, there is no such possibility.

bchinnari commented 7 years ago

With small hack, we are able to launch the worker when status listener arrives. But we are not able close the worker when listener leaves. Could you help in this.

The hack is one statement

class StatusSocketHandler(tornado.websocket.WebSocketHandler):

def check_origin(self, origin):
    return True
def open(self):
    logging.info("New status listener")
    **os.system("supervisord -c /home/aai/supervisord_1worker.conf")**
    self.application.status_listeners.add(self)
    self.application.send_status_update_single(self)
alumae commented 7 years ago

Sorry, you are on your own with this.

bchinnari commented 7 years ago

I would like to know if it is possible at all