Coder Social home page Coder Social logo

mythological / vosk-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alphacep/vosk-server

0.0 1.0 0.0 908 KB

Simple websocket/grpc server for speech recognition based on Vosk library

License: Apache License 2.0

Python 42.16% Shell 0.80% C# 4.46% JavaScript 5.25% PHP 2.13% Makefile 0.54% TypeScript 38.20% HTML 2.23% CSS 0.42% Java 3.80%

vosk-server's Introduction

A very simple server based on Vosk-API.

There are three implementations for different protocol - websocket, grpc, mqtt.

Usage

Start the server

docker run -d -p 2700:2700 alphacep/kaldi-en:latest

or for Chinese. The model is based on Kaldi multi-cn recipe, thanks to Xingyu Na.

docker run -d -p 2700:2700 alphacep/kaldi-cn:latest

or for Russian

docker run -d -p 2700:2700 alphacep/kaldi-ru:latest

or for German (model from https://github.com/uhh-lt/kaldi-tuda-de#pretrained-models)

docker run -d -p 2700:2700 alphacep/kaldi-de:latest

Run

git clone https://github.com/alphacep/vosk-server
cd vosk-server/websocket
./test.py test.wav

You can try with any wav file which has proper format - 8khz 16bit mono PCM. Other formats has to be converted before decoding.

Testing with microphone

You would need to install the pyaudio pip package:

pip install pyaudio

(on Windows, it's easiest to install the wheel from here).

To test with a microphone, run

./test_microphone.py localhost:2700

Connected to ws://localhost:2700
Type Ctrl-C to exit
{"partial" : ""}
{"partial" : "поднимите мне веки"}
{"partial" : "поднимите мне веки"}
{"result" : [ {"word": "поднимите", "start" : 3.45, "end" : 4.26, "conf" : 1},
{"word": "мне", "start" : 4.26, "end" : 4.47, "conf" : 1},
{"word": "веки", "start" : 4.47, "end" : 5.07, "conf" : 1}
 ], "text" : "поднимите мне веки" }
{"partial" : ""}
Closing PyAudio Stream
Terminating PyAudio object
Terminating connection
{"result" : [  ], "text" : "" }
Bye

Other programming languages

Check other examples (Asterisk-EAGI, php, java, node, c#) in client-samples folder in this repository.

vosk-server's People

Contributors

morfeusys avatar naxingyu avatar nshmyrev avatar sskorol 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.