Python interface to CMU Sphinxbase and Pocketsphinx libraries
Project description
Python interface to CMU Sphinxbase and Pocketsphinx libraries created with SWIG. Pocketsphinx packages include python support, however, it is based on Automake and not well supported on Windows. Pocketsphinx is part of the CMU Sphinx Open Source Toolkit For Speech Recognition.
This package provides module created with Python distutils setup and can be more portable.
Supported Platforms
Windows 7
Windows 8
Ubuntu 14.04
Install on Windows
Requirements
Install
# From pip
$ pip install pocketsphinx
# From source
$ git clone --recursive https://github.com/bambocher/pocketsphinx-python
$ cd pocketsphinx-python
$ python setup.py install
Install on Ubuntu
Requirements
python
python-dev
python-pip
build-essential
swig
git
Install
# From pip
$ sudo apt-get install -qq python python-dev python-pip build-essential swig
$ sudo pip install pocketsphinx
# From source
$ sudo apt-get install -qq python python-dev python-pip build-essential swig git
$ git clone --recursive https://github.com/bambocher/pocketsphinx-python
$ cd pocketsphinx-python
$ sudo python setup.py install
Basic usage
#!/usr/bin/env python
import os
import sphinxbase as sb
import pocketsphinx as ps
MODELDIR = 'deps/pocketsphinx/model'
DATADIR = 'deps/pocketsphinx/test/data'
# Create a decoder with certain model
config = ps.Decoder.default_config()
config.set_string('-hmm', os.path.join(MODELDIR, 'en-us/en-us'))
config.set_string('-lm', os.path.join(MODELDIR, 'en-us/en-us.lm.bin'))
config.set_string('-dict', os.path.join(MODELDIR, 'en-us/cmudict-en-us.dict'))
decoder = ps.Decoder(config)
# Decode streaming data.
decoder.start_utt()
stream = open(os.path.join(DATADIR, 'goforward.raw'), 'rb')
while True:
buf = stream.read(1024)
if buf:
decoder.process_raw(buf, False, False)
else:
break
decoder.end_utt()
stream.close()
print('Best hypothesis segments:', [seg.word for seg in decoder.seg()])
Projects using pocketsphinx-python
SpeechRecognition - Library for performing speech recognition, with support for several engines and APIs, online and offline.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pocketsphinx-0.1.0.win-amd64-py3.5.msi
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f256e88c0b322f7eb402195036675a3ec3671a9e8d9323cd84c0d044199c86d |
|
MD5 | 2d96836e73650fce095f5dbd29840011 |
|
BLAKE2b-256 | 2d95baa873ed5257b24f4fab937290108156b9e1b7b139364df7f599e4309b2b |
Hashes for pocketsphinx-0.1.0.win-amd64-py3.5.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b0b1125f9af2fe5f46985d065565353f6682592fc3022d1e2cc8a9a2b4b59b0 |
|
MD5 | 65ce944c989c62ef99200340408fa3fb |
|
BLAKE2b-256 | f0dcf2aa5a7e705378c7cbbc4f1d4451d1214c9dd188207e9c571db99e7b1c2a |
Hashes for pocketsphinx-0.1.0.win-amd64-py2.7.msi
Algorithm | Hash digest | |
---|---|---|
SHA256 | e06788044c675e24e97ba4a95beca470a46a87d4be3b712d9f863180bdd2de66 |
|
MD5 | 8e67457a567fde16d030df6cb9ee8f70 |
|
BLAKE2b-256 | 911df55fe20f9660ea63fbbee5404207ced71585f393e00723fa1ac8dbc92dd5 |
Hashes for pocketsphinx-0.1.0.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | c148112a14f9f8090c83e077ac74cdaeb7e265b69805346db9ef8f5457cf03c8 |
|
MD5 | df1c8a26ea39f730f152298d488fd439 |
|
BLAKE2b-256 | 63efe8b802798e43edde8ad02eeb6d36970278f6ce009a45075258aab1300de1 |
Hashes for pocketsphinx-0.1.0.win32-py3.5.msi
Algorithm | Hash digest | |
---|---|---|
SHA256 | af27a3faa2fead977bebf8aa1f1e8ae847c944a083bbc917a83a6418899b82ef |
|
MD5 | b5b4c4368ec9af871d52e4bb0a02b771 |
|
BLAKE2b-256 | 0e604eb7bef5db3d4ec4ec3757fe22f20f0ba1bb1ee9f0204a74f8bedb2042a5 |
Hashes for pocketsphinx-0.1.0.win32-py3.5.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c8dc9a31ad0d913e9514c4b8e9a408f1534a60a3deca095dad5452f180fb67 |
|
MD5 | d42b4a196169303862d764cf2e646739 |
|
BLAKE2b-256 | 8382ee5f031200a376319b690c35703b01cb5779749b6cce7aa43c640c253cf3 |
Hashes for pocketsphinx-0.1.0.win32-py2.7.msi
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab6be490dc7ba4ae02d75000f3015b113db17fa2aab16b10fb146302e7c432cb |
|
MD5 | dc2489b2c61b813e3822719401f628d2 |
|
BLAKE2b-256 | c625f40fe37e9f305a99c9968ca68f81074be4b9dfc95632f7f40215200a7962 |
Hashes for pocketsphinx-0.1.0.win32-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4994d50939a664f71f8df6bb6db9fc366241263fa9d9dc4d333a3e046a2d3a2 |
|
MD5 | 29f3e1945d71ceabb1f85a42b7639ccc |
|
BLAKE2b-256 | 05141fc2899825ef7bc136a0bab1208c52a488ed7b05711fbb1d3e866ab7a541 |
Hashes for pocketsphinx-0.1.0-py3.5-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ff9120d4f537609c1cf38a2e6e789f8c95c07918e56c9aca99e15ab81beb341 |
|
MD5 | 308dfd8ec2af6d6f7fb769bc01ff8346 |
|
BLAKE2b-256 | 369f88460b4a91ba2a0fe740aef09551be0252ee7cb617d2642c1104743cea3b |
Hashes for pocketsphinx-0.1.0-py3.5-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7ad00182d3a5fe9868dabd764ee454df32643f48978b35a97369773bd7a8e56 |
|
MD5 | ee451e5b275b8817cd57f3c3b60490f5 |
|
BLAKE2b-256 | 2622d662d83e4543fa042491bd2361419113fb54e0e73418e6895ecbd79aeea3 |
Hashes for pocketsphinx-0.1.0-py3.5-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c2abdbdfd351f68ceead52f0a877354d955937af22ed89dc6b913819ef6944 |
|
MD5 | 9d62fc78c31be9f544d95e61ffcbe0ec |
|
BLAKE2b-256 | 019ac5b672335add15b88067494d1f48b498b9b4796cd855973170b2e0e564f2 |
Hashes for pocketsphinx-0.1.0-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21bbcc16f1be831d1c7bc5a9657c2fd3af298dbf8fe3aae0b81baec7f6fa281f |
|
MD5 | ba4778bc69a4152b36d2a757cc1430ca |
|
BLAKE2b-256 | 2953510fbc8569b6d76713151ba0ed85597ab3e790eee73c8b9bfbafd2029b92 |
Hashes for pocketsphinx-0.1.0-py2.7-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e667081c0daaa0bd8465b64e6b9f3ca132a4a265dfaced69b0de1000d22f8883 |
|
MD5 | 7938cd245c284d0049723e4d859bcb8c |
|
BLAKE2b-256 | b500c317fbefcdcdf04ccab2ad35d746faa4e776c777d22e9b2bea13e4c1decc |
Hashes for pocketsphinx-0.1.0-py2.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e591d6a46a85f09ce2e1bfe84317c5901c893b669b898a9d42a96ee5e4bbea2 |
|
MD5 | 6d2707c524902018af03d263034f2a45 |
|
BLAKE2b-256 | bf5e555ef6fd2fc9fdae688489d677d876b43f40961e5cba80512ce7876c5fc4 |
Hashes for pocketsphinx-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cc27b5eb822dd53889942387e1134d7b808c579fa518aa5e1cb9ddbf3c0bcc9 |
|
MD5 | afb9b4f26f7d3a2f90bf8d6f627d7e89 |
|
BLAKE2b-256 | 91ee429281edb3366c4fc9491f1e38f63c17683dd6b3d76c97cc62ba6f9b504e |
Hashes for pocketsphinx-0.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb21d41c9f6e14530b19ce3ad6b5a94290345a75497a8d4c06d2aa85b0c29a3c |
|
MD5 | 8039e85d097b08980b8596e156967c66 |
|
BLAKE2b-256 | 83c7fd47e31a848c05562fe8c6f221fff7a45a030f08d026d0d397aabf48d903 |
Hashes for pocketsphinx-0.1.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fae2207ff840ac89b7cb87798608dd716979f147986b42ab697aa48910baaa3 |
|
MD5 | f8f40388be86c1eff4dcb456ae48913f |
|
BLAKE2b-256 | 8671442d44face1349cd4b71aab9ba8a786e64708d617126ca262702da3d04c7 |
Hashes for pocketsphinx-0.1.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36cdc1b1f2195541668d7d3dbd325e250119c6836db0aa7f1cb6d00ce79d59e8 |
|
MD5 | f2b8ccba2cc27604b03ac8f9ae32bcb3 |
|
BLAKE2b-256 | c3832ef97583d8dd8c23448cff9cae22279fbf9e871ee522a72b776e09810827 |