Skip to main content

'Ok Hound' phrase spotter

Project description

OkHound module

A python wrapper for the "Ok Hound" phrase spotter.

Install

  1. Install the header files for the Python C API, python-dev / python-devel;

  2. Run pip install okhound

Example script

import okhound
import pyaudio


CHUNKSIZE = 1024

audio = pyaudio.PyAudio()
stream = audio.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=CHUNKSIZE)

okhound.setThreshold(0.4)

while True:
	try:
		audio = stream.read(CHUNKSIZE)
	except IOError:
		print("Skipped frame")
		continue

	phraseSpotted = okhound.processSamples(audio)
	if phraseSpotted: break


print("'Ok Hound' spotted! Sensitivity: {0}".format(okhound.getThreshold()))

Run example script

  1. Install PortAudio development tools, portaudio19-dev / libportaudio-devel;

  2. Install pyaudio module, pip install pyaudio;

  3. Run example_pyaudio.py script, python example_pyaudio.py.

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

OkHound-0.2.1.tar.gz (5.4 MB view hashes)

Uploaded Source

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