https://github.com/charithe/porcupine-go
Go wrapper for PicoVoice Porcupine wake-word detection engine
https://github.com/charithe/porcupine-go
audio-analysis cgo go golang hotword-detection porcupine voice-commands voice-control wake-word-detection
Last synced: about 2 months ago
JSON representation
Go wrapper for PicoVoice Porcupine wake-word detection engine
- Host: GitHub
- URL: https://github.com/charithe/porcupine-go
- Owner: charithe
- License: apache-2.0
- Created: 2018-10-21T12:56:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-11T15:50:56.000Z (over 7 years ago)
- Last Synced: 2025-08-14T02:24:01.038Z (8 months ago)
- Topics: audio-analysis, cgo, go, golang, hotword-detection, porcupine, voice-commands, voice-control, wake-word-detection
- Language: Go
- Size: 1.24 MB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Go Wrapper For Picovoice Porcupine
===================================
[](https://godoc.org/github.com/charithe/porcupine-go)
A Go wrapper for the [Picovoice Porcupine](https://github.com/Picovoice/Porcupine) wake-word detection engine.
```
go get github.com/charithe/porcupine-go
```
Requires the `pv_porcupine` library to be available in the `LD_LIBRARY_PATH` and `pv_porcupine.h` to be in the include path.
For example, on 64-bit Linux:
```shell
cp Porcupine/lib/linux/x86_64/* /usr/local/lib64/
cp Porcupine/include/* /usr/local/include
```
Demo
----
The demo application reads a 16-bit PCM S16LE stream from stdin and prints out the detected words to the console.
Accepted command-line argument are as follows:
```
-input string
Path to read input audio from (PCM 16-bit LE) (default "-")
-keyword value
Colon separated keyword, data file and sensitivity values (Eg. pineapple:pineapple_linux.ppn:0.5)
-model_path string
Path to the Porcupine model
```
### Single Keyword
The following invocation detects the word "pineapple" from the default audio input source.
```shell
gst-launch-1.0 -v alsasrc ! audioconvert ! audioresample ! audio/x-raw,channels=1,rate=16000,format=S16LE ! filesink location=/dev/stdout | \
go run cmd/demo/main.go \
-model_path=resources/porcupine_params.pv \
-keyword=pineapple:resources/pineapple_linux.ppn:0.5
```
### Multiple Keywords
The following invocation detects "pineapple", "blueberry" and "grapefruit" from the default audio input source.
```shell
gst-launch-1.0 -v alsasrc ! audioconvert ! audioresample ! audio/x-raw,channels=1,rate=16000,format=S16LE ! filesink location=/dev/stdout | \
go run cmd/demo/main.go \
-model_path=resources/porcupine_params.pv \
-keyword=pineapple:resources/pineapple_linux.ppn:0.5 \
-keyword=blueberry:resources/blueberry_linux.ppn:0.5 \
-keyword=grapefruit:resources/grapefruit_linux.ppn:0.5
```