Skip to main content

Tools for real time speech processing, keyword spotting (compatibility for python 3.5 and earlier)

Project description

PyRTSTools

Introduction

Python Real Time Speech Tools is a collection of classes designed to develop a real-time speech processing pipeline for voice user interface.

Disclaimer: This is an early version designed to provide a voice command detection pipeline for LinTO. However the elements are designed to be generic and can be used for other purposes.

Features

pyrtstools features different blocks:

  • Audio acquisition
  • Voice activity detection
  • Feature extraction
  • Keyword spotting

All the element are designed to be easy to use and easy to interconnect.

Installation

In order to install the package you need python3 and pip/setuptools installed.

Recquired libraries are:

  • portaudio19-dev (For pyaudio microphone input)

The python dependecies are automaticly installed. (Note that it may takes some time as some of them -numpy, tensorflow- are faily large)

pypi

sudo pip3 install pyrtstools

From source

git clone https://github.com/linto-ai/pyrtstools.git
cd pyrtstools
sudo ./setup.py install

Usage

Here are a simple pipeline designed to detect hotword from microphone

import pyrtstools as rts

audioParam = rts.listenner.AudioParams() # Hold signal parameters
listenner = rts.listenner.Listenner(audioParam) # Microphone input
vad = rts.vad.VADer() # Voice activity detection
btn = rts.transform.ByteToNum(normalize=True) #Convert raw signal to numerical
featParams = rts.features.MFCCParams() # Hold MFCC features parameters
mfcc = rts.features.SonopyMFCC(featParams) # Extract MFCC
kws = rts.kws.KWS("/path/to/your-model.pb", (30,13)) # Hotword spotting 
pipeline = rts.Pipeline([listenner, vad, btn, mfcc, kws]) # Holds elements and links them
pipeline.start() # Start all the elements
try:
    listenner.join() # Wait for the microphone to finish (To block the execution)
except KeyboardInterrupt:
    pipeline.close()

Every block is located in a subpackage:

  • Audio acquisition: pyrtstools.listenner
  • Voice activity detection: pyrtstools.vad
  • Features extraction: pyrtstools.features
  • Keyword spotting: pyrtstools.kws
  • Signal transformation: pyrtstools.transform

Every element and class is documented.

Licence

This project is under aGPLv3 licence, feel free to use and modify the code under those terms. See LICENCE

Used libraries

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyrtstools, version 0.2.6
Filename, size & hash File type Python version Upload date
pyrtstools-0.2.6-py3-none-any.whl (29.8 kB) View hashes Wheel py3
pyrtstools-0.2.6.tar.gz (11.4 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page