deepspeech-websocket-server
deepspeech-websocket-server copied to clipboard
Give client a Python interface
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).
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.
@TMiguelT Cleanup complete. Also refactored some to ease external usage.
if you could clearly describe about this issue, I will be very happy to become a contributor to this repo.
@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.