Code Monkey home page Code Monkey logo

porcupine-go's Introduction

Go Wrapper For Picovoice Porcupine

GoDoc

A Go wrapper for the 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:

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.

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.

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

porcupine-go's People

Contributors

charithe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tystuyfzand

porcupine-go's Issues

Go get on pi zero w fails

After cloning the Porcupine repo and moving the libs and includes into /usr/local/... running the command:
go get github.com/charithe/porcupine-go
fails with the error:
go/src/github.com/charithe/porcupine-go/porcupine.go:131:21: type [1073741823]*_Ctype_char too large

This is on the raspberry pi zero w running raspian stretch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.