• Stars
    star
    149
  • Rank 248,549 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

To build voice enabled objects/applications with Python and ReSpeaker

ReSpeaker Python Library

Build Status

ReSpeaker is an open project to create voice enabled objects. ReSpeaker python library is an open source python library to provide basic functions of voice interaction.

It uses PocketSphinx for keyword spotting and uses webrtcvad for voice activity detecting.

Installation (Not for ReSpeaker Core)

Note: This library is already installed on ReSpeaker Core by default. Please skip the installation step and don't re-install it

python and pip are required.

  1. Install pocketsphinx, webrtcvad

On windows, we can use pre-compiled python wheel packages of pocketsphinx and pyaudio from speech_recognition. For python 2.7, run:

pip install https://github.com/respeaker/respeaker_python_library/releases/download/v0.4.1/pocketsphinx-0.0.9-cp27-cp27m-win32.whl
pip install https://github.com/respeaker/respeaker_python_library/releases/download/v0.4.1/webrtcvad-2.0.9.dev0-cp27-cp27m-win32.whl

On Linux

pip install pocketsphinx webrtcvad
  1. pip install pyaudio respeaker --upgrade

  2. Install hidapi (optional)

MacOSX install ReSpeaker Python Library

0.(brew install python2)

1.pip2 install pocketsphinx webrtcvad

2.(Since pyAudio has portAudio as a dependency, you first have to install portaudio: brew install portaudio) pip install pyaudio respeaker --upgrade 3.Install hidapi (optional)

stdio.h file not found error on macOS Mojave

For anyone discovering this later on who may not be familiar with the command line, here's how to install the macOS_SDK_headers_for_macOS_10.14.pkg package as explained in @yicongli's response above:

In Terminal.app or any shell app like iTerm:

cd /Library/Developer/CommandLineTools/Packages/ open macOS_SDK_headers_for_macOS_10.14.pkg

Make sure you go through the whole thing and try to install the gem that failed to install again or run bundle install again if this was something you encountered while trying to install from a Gemfile.

Getting started

import logging
import time
from threading import Thread, Event

from respeaker import Microphone


def task(quit_event):
    mic = Microphone(quit_event=quit_event)

    while not quit_event.is_set():
        if mic.wakeup('respeaker'):
            print('Wake up')
            data = mic.listen()
            text = mic.recognize(data)
            if text:
                print('Recognized %s' % text)


def main():
    logging.basicConfig(level=logging.DEBUG)

    quit_event = Event()
    thread = Thread(target=task, args=(quit_event,))
    thread.daemon = True
    thread.start()
    while True:
        try:
            time.sleep(1)
        except KeyboardInterrupt:
            print('Quit')
            quit_event.set()
            break
    time.sleep(1)

if __name__ == '__main__':
    main()

More Repositories

1

seeed-voicecard

2 Mic Hat, 4 Mic Array, 6-Mic Circular Array Kit, and 4-Mic Linear Array Kit for Raspberry Pi
C
472
star
2

mic_array

DOA, VAD and KWS for ReSpeaker Microphone Array
Python
286
star
3

get_started_with_respeaker

This is the wiki of ReSpeaker Core V2, ReSpeaker Core and ReSpeaker Mic Array.
Python
257
star
4

avs

python implementation of alexa voice service app, ๆ”ฏๆŒDuerOS
Python
196
star
5

usb_4_mic_array

ReSpeaker 4 Mic Array with builtin VAD, DOA, AEC, Beamforming & NS
Python
137
star
6

mic_hat

2 Mic Array for Raspberry Pi
Python
102
star
7

pixel_ring

RGB LED library for ReSpeaker 4 Mic Array, ReSpeaker V2 & ReSpeaker USB 6+1 Mic Array
Python
59
star
8

respeakerd

respeakerd is the server application for the microphone array solutions of SEEED, based on librespeaker which combines the audio front-end processing algorithms.
C++
54
star
9

Alexa

New version is at https://github.com/respeaker/avs
Python
53
star
10

respeaker_for_raspberrypi

Examples to use ReSpeaker series Mic Arrays on Raspberry Pi
Python
41
star
11

4mics_hat

Python
34
star
12

respeaker-feed

C
20
star
13

mic_array_dfu

ReSpeaker Microphone Array DFU tool for firmware upgrade
C
19
star
14

respeaker_arduino_library

C++
18
star
15

pocketsphinx_keyword_spotting

Use Pocketsphinx to detect keywords offline
Python
12
star
16

microsoft_cognitive_services

Not updated, use
Python
11
star
17

Music_Visualizer

Music Player with Spectrum
Python
8
star
18

ok_google

hands-free google assistant with respeaker
Python
8
star
19

respeaker_v2_eval

respeaker v2 ่ฏ„ไผฐๆฟๅ…ฅๅ‘ๆŒ‡ๅ—
Python
8
star
20

respeaker.github.io

6
star
21

piano

Turn ReSpeaker into a Piano (with Fruit)
Python
6
star
22

w

Send Wi-Fi settings through sound wave http://respeaker.io/w
Python
6
star
23

googleassistant_respeakerd

Adapt google assistant's gRPC sample app for working with respeakerd
Python
6
star
24

respeaker_frontend

JavaScript
5
star
25

spi_bridge

SPI bridge between Arduino (ATmega32u4) and ReSpeaker (MT7688), ATmega32u4 as a SPI slave
Python
5
star
26

pocketsphinx-data

PocketSphinx's acoustic model, dictionary and keywords
Shell
5
star
27

rkbin

Shell
4
star
28

respeaker_hi

Python
4
star
29

FasterConfig

A faster way to setup wifi
C++
4
star
30

deb_repos

Roff
3
star
31

axol_system_image_changelog

ReSpeaker Core v2 image changelog, TODO and collecting issues.
2
star
32

image_builder

Shell
2
star
33

respeaker_openwrt_files

openwrt files for respeaker
Shell
2
star
34

respeaker_virtualenv

Python
2
star
35

source_builder

Shell
1
star
36

orangerpcd

Shell
1
star
37

mopidy-hallo

Voice Interaction with Mopidy
Python
1
star
38

toolchains

1
star
39

docs

ReSpeaker Documents
HTML
1
star
40

deb

deb package repository for respeaker v2
1
star