Giter VIP home page Giter VIP logo

porcupinepipeline's Introduction

PorcupinePipeline

Use a raspberry pi and microphone to trigger a wake word for a conversation with a Home-Assistant Voice Assistant

https://www.home-assistant.io/voice_control/

Usage and Example

Required Authentication

- From Picovoice access_key for Porcupine wake word detection
    (Please note that your Picovoice user is only allowed one unique device.
    Running the docker image can result in a new device 
    that will prevent you from using Picovoice
    See: https://github.com/Picovoice/porcupine/issues/1020)

- From Home-Assistant long-lived access token

Environment Variables:

SERVER              Home-Assistant FQDN
SERVER_PORT         Home-Assistant port
SERVER_HTTPS        Home-Assistant using https
TOKEN               Home-Assistant long-lived access token
PIPELINE            Home-Assistant voice pipeline name

ACCESS_KEY          Picovoice access_key
KEYWORDS            Wake words to trigger voice pipeline
KEYWORD_PATHS       Absolute paths to keyword model files
LIBRARY_PATH        Absolute path to dynamic library
MODEL_PATH          Absolute path to the file containing model parameters

AUDIO_DEVICE        Index of audio device for microphone
AUDIO_RATE          Rate of input audio
AUDIO_WIDTH         Width of input audio sample
AUDIO_CHANNELS      Number of input audio channels
OUTPUT_PATH         Absolute path to recorded audio

Run:

cd /usr/src
git clone https://github.com/slackr31337/PorcupinePipeline.git

export ACCESS_KEY='my-picovoice-access-key'
export TOKEN='my-home-assistant-token'
export SERVER=home-assistant.local
export PIPELINE=OpenAI
export AUDIO_DEVICE=1

python3 ./voice_pipeline.py --server home-assistant.local --pipeline 'OpenAI' --follow-up

Tested with:

wyoming-piper <https://hub.docker.com/r/rhasspy/wyoming-piper>
wyoming-whisper <https://hub.docker.com/r/rhasspy/wyoming-whisper>
Home-Assistant 2023.06.1 to 2023.08.2 <https://www.home-assistant.io/>

Used code from the following projects

- https://github.com/synesthesiam/homeassistant-pipeline/blob/master/audio_to_audio.py

- https://github.com/Picovoice/porcupine/blob/master/demo/python/porcupine_demo_mic.py

https://github.com/Picovoice/porcupine
AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)

https://picovoice.ai/platform/porcupine/
https://picovoice.ai/docs/porcupine/

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.