Skip to main content

Rhino Speech-to-Intent engine demos.

Project description

Rhino Speech-to-Intent Engine Demos

Made in Vancouver, Canada by Picovoice

This package contains demos and commandline utilities for processing real-time audio (i.e. microphone) and audio files using Rhino Speech-to-Intent engine.

Rhino

Rhino is Picovoice's Speech-to-Intent engine. It directly infers intent from spoken commands within a given context of interest, in real-time. For example, given a spoken command "Can I have a small double-shot espresso with a lot of sugar and some milk", Rhino infers that the user wants to order a drink with these specifications:

{
  "type": "espresso",
  "size": "small",
  "numberOfShots": "2",
  "sugar": "a lot",
  "milk": "some"
}

Rhino is:

  • using deep neural networks trained in real-world environments.
  • compact and computationally-efficient, making it perfect for IoT.
  • self-service. Developers and designers can train custom models using Picovoice Console.

Compatibility

  • Python 3
  • Runs on Linux (x86_64), Mac (x86_64), Windows (x86_64), Raspberry Pi (all variants), and BeagleBone.

Installation

Microphone demo uses PyAudio for recording input audio. Consult the installation guide at PyAudio.

sudo pip3 install pvrhinodemo

Usage

File Demo

It allows testing Rhino on a corpus of audio files. The demo is mainly useful for quantitative performance benchmarking. It accepts 16kHz audio files. Rhino processes a single-channel audio stream if a stereo file is provided it only processes the first (left) channel. Note that only the relevant spoken command should be present in the file and no other speech. Also there needs to be at least one second of silence at the end of the file.

rhino_demo_file --input_audio_path ${AUDIO_PATH} --context_path ${CONTEXT_PATH} 

Microphone Demo

It opens an audio stream from a microphone and performs inference in spoken commands

rhino_demo_mic --context_path ${CONTEXT_PATH}

It is possible that the default audio input device recognized by PyAudio is not the one being used. There are a couple of debugging facilities baked into the demo application to solve this. First, type the following into the console

rhino_demo_mic --show_audio_devices

It provides information about various audio input devices on the box. On a Linux box, this is the console output

'index': '0', 'name': 'HDA Intel PCH: ALC892 Analog (hw:0,0)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '2'
'index': '1', 'name': 'HDA Intel PCH: ALC892 Alt Analog (hw:0,2)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '2'
'index': '2', 'name': 'HDA NVidia: HDMI 0 (hw:1,3)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '3', 'name': 'HDA NVidia: HDMI 1 (hw:1,7)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '4', 'name': 'HDA NVidia: HDMI 2 (hw:1,8)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '5', 'name': 'HDA NVidia: HDMI 3 (hw:1,9)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '6', 'name': 'HDA NVidia: HDMI 0 (hw:2,3)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '7', 'name': 'HDA NVidia: HDMI 1 (hw:2,7)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '8', 'name': 'HDA NVidia: HDMI 2 (hw:2,8)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '9', 'name': 'HDA NVidia: HDMI 3 (hw:2,9)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '10', 'name': 'Logitech USB Headset: Audio (hw:3,0)', 'defaultSampleRate': '44100.0', 'maxInputChannels': '1'
'index': '11', 'name': 'sysdefault', 'defaultSampleRate': '48000.0', 'maxInputChannels': '128'
'index': '12', 'name': 'front', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '13', 'name': 'surround21', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '14', 'name': 'surround40', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '15', 'name': 'surround41', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '16', 'name': 'surround50', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '17', 'name': 'surround51', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '18', 'name': 'surround71', 'defaultSampleRate': '44100.0', 'maxInputChannels': '0'
'index': '19', 'name': 'pulse', 'defaultSampleRate': '44100.0', 'maxInputChannels': '32'
'index': '20', 'name': 'dmix', 'defaultSampleRate': '48000.0', 'maxInputChannels': '0'
'index': '21', 'name': 'default', 'defaultSampleRate': '44100.0', 'maxInputChannels': '32'

It can be seen that the last device (index 21) is considered default. But on this machine, a headset is being used as the input device which has an index of 10. After finding the correct index the demo application can be invoked as below

rhino_demo_mic --context_path ${CONTEXT_PATH} --audio_device_index 10

If the problem persists we suggest storing the recorded audio into a file for inspection. This can be achieved by

rhino_demo_mic --context_path ${CONTEXT_PATH} --audio_device_index 10 --output_path ~/test.wav

Project details


Download files

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

Source Distribution

pvrhinodemo-1.3.6.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

pvrhinodemo-1.3.6-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pvrhinodemo-1.3.6.tar.gz.

File metadata

  • Download URL: pvrhinodemo-1.3.6.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for pvrhinodemo-1.3.6.tar.gz
Algorithm Hash digest
SHA256 e83763a75e42de0b80704c86d54bc47f0b2bd7eedd5810639b0971ff480bc3b0
MD5 55f0e65bac6db7710f3c2317afba954c
BLAKE2b-256 40773ed5f1f38d0aaab543f02f3d0d9cb859e6e53ccdf9d80112ffddb108fdf0

See more details on using hashes here.

File details

Details for the file pvrhinodemo-1.3.6-py3-none-any.whl.

File metadata

  • Download URL: pvrhinodemo-1.3.6-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for pvrhinodemo-1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 83dfba7a2bc50e46d125db7e58fb847fc6fcd34cd5100eb0b6e3f8ddc023b25a
MD5 3f48168472cf98e284f69dee0b10541f
BLAKE2b-256 75b4f65d1cbb417abfa22b09c898ddf7e6de9b95587ae575fe0e68b14cf43507

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page