GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rakeshv247/speechmatics-python: Python library and CLI for Speechmatics

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

107 Commits
107 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
docs
docs
 
 
speechmatics
speechmatics
 
 
sphinx
sphinx
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.pylintrc
.pylintrc
 
 
.travis.yml
.travis.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.txt
LICENSE.txt
 
 
MANIFEST.in
MANIFEST.in
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
VERSION
VERSION
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements.txt
requirements.txt
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

speechmatics-python   Build Status License codecov

speechmatics-python provides a reference client for interfacing with the Speechmatics Realtime ASR API v2. A command line interface is also included for convenience.

Getting started

To install from source:

$ git clone https://github.com/speechmatics/speechmatics-python
$ cd speechmatics-python && python setup.py install

# or

$ pip install -e git+https://github.com/speechmatics/speechmatics-python#egg=speechmatics-python

Requirements

  • Python 3.7+

Example command-line usage

  • A normal real time session using a .wav file as the input audio

    # Point URL to the local instance of Speechmatics
    $ URL=ws://realtimeappliance.yourcompany:9000/v2
    
    $ speechmatics transcribe --url $URL --lang en --ssl-mode none example_audio.wav
  • Show the messages that are going over the websocket connection

    $ speechmatics -v transcribe --url $URL --lang en --ssl-mode none example_audio.wav
  • The CLI also accepts an audio stream on standard input; transcribe the piped input audio

    $ cat example_audio.wav | speechmatics transcribe --ssl-mode none --url $URL --lang en -
  • Pipe audio directly from the microphone (example uses MacOS with ffmpeg)

    List available input devices with

    $ ffmpeg -f avfoundation -list_devices true -i ""

    There needs to be at least one available microphone attached to your computer. The command below gets the microphone input and pipes it to the transcriber. You may need to change the sample rate to match the sample rate that your machine records at. You may also need to replace :default with something like :0 or :1 if you want to use a specific microphone.

    $ ffmpeg -loglevel quiet -f avfoundation -i ":default" -f f32le -acodec pcm_f32le -ar 44100 - \
    >   | speechmatics transcribe --ssl-mode none --url $URL --raw pcm_f32le --sample-rate 44100 --lang en -
  • Transcribe in real-time with partials (example uses Ubuntu with ALSA). In this mode, the transcription engine produces words instantly, which may get updated as additional context becomes available.

    List available input devices with

    $ cat /proc/asound/cards

    Record microphone audio and pipe to transcriber.

    $ ffmpeg -loglevel quiet -f alsa -i hw:0 -f f32le -acodec pcm_f32le -ar 44100 - \
        | speechmatics transcribe --ssl-mode none --url $URL --enable-partials --raw pcm_f32le --sample-rate 44100 --lang en -

API documentation

Please see https://speechmatics.github.io/speechmatics-python/.

Testing

To install development dependencies and run tests

$ pip install -r requirements-dev.txt
$ make test

Support

If you have any issues with this library or encounter any bugs then please get in touch with us at [email protected].


License: MIT

About

Python library and CLI for Speechmatics

speechmatics.github.io/speechmatics-python/

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.