deepspeech-websocket-server icon indicating copy to clipboard operation
deepspeech-websocket-server copied to clipboard

Give client a Python interface

Open multimeric opened this issue 6 years ago • 4 comments

The sound detection and websocket streaming you've implemented is fantastic. However I'm interested in using the client in another Python application. Do you think we could look into cleaning it up and making it importable? The CLI should stay obviously, but ideally there'd be a single entry point function that could be called by some other Python code, or by the CLI/argparse interface.

I'll write a PR for this if you're interested (and once I get some time).

multimeric avatar Dec 19 '18 14:12 multimeric

Sure; good idea, and a PR would be great! Actually, I have some cleanup to commit for the client that might help, which I'll try to complete in a day or two.

daanzu avatar Dec 20 '18 06:12 daanzu

@TMiguelT Cleanup complete. Also refactored some to ease external usage.

daanzu avatar Dec 21 '18 09:12 daanzu

if you could clearly describe about this issue, I will be very happy to become a contributor to this repo.

imKarthikeyanK avatar Dec 27 '18 09:12 imKarthikeyanK

@daanzu, thanks for the cleanup!

I still believe there is some work that needs to be done though. The main thing this needs is the ability to import the client in another python package (@imKKK). For instance:

from deepspeech_websocket_server.client import Client

def callback(recognition):
    print(f"Recognised {recognition}")

Client().recognise(callback)

This would allow us to use the great VAD + DeepSpeech integration in another application, for example a custom web application.

I've slowly started looking into making a PR for this though, so don't stress if none of you get the chance to do this.

multimeric avatar Jan 03 '19 13:01 multimeric