Code Monkey home page Code Monkey logo

ws-deepspeech's Introduction

DeepSpeech over Websocket

A DeepSpeech webserver with resampling capabilities that run over websockets through Starlette.

Requirements

Installation

I'm using miniconda so:

$ conda create --name wsDSpeech python=3.6 # or 3.7
$ conda activate wsDSpeech
$ pip install -r requirements.txt

Run

First, set up the correct INPUT_SAMPLE_RATE in appConfig according to the audio file that will be streamed to the server.

Then, if you want to use the Dockerfile just run:

$ docker build -t deepspeech .
$ docker run -t deepspeech

or locally:

$ cp appConfig app/appConfig
$ gunicorn -c guConfig.py app:app

Now you can reach the server at:

http://127.0.0.1:5000

for a cutie hello world

Meanwhile a thread starts and downloads DeepSpeech models if not present.

Client example

In the example folder there are two simple clients.

Java

  • Choose how many connections:
     nrClient=2

Python (work in progress..)

  • Just run it

     cd examples/python
     python simpleClient.py

Settings

  • appConfig contains all the settings used.

  • On first run, DeepSpeech models will be downloaded under the DEEPSPEECH_ROOT_PATH.

  • If you want more verbosity, flag VERBOSE/DEBUG to True

  • guConfig contains all the settings related to GUnicorn, including the deepspeech model downloading part.

TODOs

  • Python client example with more connections
  • Manage memory leaking (avoid to force workers restart)
  • Handle async/future exceptions
  • Use a lighter docker as base image (Alpine?)

ws-deepspeech's People

Contributors

dependabot[bot] avatar nefastosaturo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.