This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last Updated June 7th 2018 | |
This Gist assumes that you are looking to run an always listening voice assitant client on a raspberry pi with a microphone/webcam | |
and then host the actual transcription service on something more beefy like a private server or VPS with which the raspberry pi | |
communicates. Going to extend this model and add a bunch of runtime flags for both whisper and assistant mock up, but later. | |
1. On a fresh Rasbian image run this Gist/Script to set everything up: https://gist.github.com/malceore/21477f76665001f119d6ab01236e0660 | |
2. Then on your home server you will need to install Whisper: https://github.com/malceore/whisper . | |
3. Next you can put this Python client script in /<where-ever-you-installed-it>/snowboy/examples/Python/ on your Raspberry Pi as main.py : | |
#============================================ | |
import pyaudio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.web import server, resource | |
from twisted.internet import reactor, endpoints | |
class Counter(resource.Resource): | |
isLeaf = True | |
numberRequests = 0 | |
def render_GET(self, request): | |
self.numberRequests += 1 | |
request.setHeader(b"content-type", b"text/plain") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -e | |
echo "Removing Bloat.." | |
# Remove bloatware (Wolfram Engine, Libre Office, Minecraft Pi, sonic-pi dillo gpicview penguinspuzzle oracle-java8-jdk openjdk-7-jre oracle-java7-jdk openjdk-8-jre) | |
sudo apt-get remove --purge wolfram-engine libreoffice* scratch minecraft-pi sonic-pi dillo gpicview penguinspuzzle oracle-java8-jdk openjdk-7-jre oracle-java7-jdk openjdk-8-jre -y | |
# Autoremove | |
sudo apt-get autoremove -y | |
# Clean | |
sudo apt-get autoclean -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int one = 19; | |
int two = 20; | |
int three = 21; | |
int four = 18; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(four, OUTPUT); | |
pinMode(one, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Globals | |
int ONE = 19; | |
int TWO = 20; | |
int THREE = 21; | |
int FOUR = 18; | |
void setup() { | |
// Put your setup code here, to run once: | |
pinMode(ONE, OUTPUT); | |
pinMode(TWO, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, socket, threading, time, subprocess, mimetypes, struct, wave, serial | |
from urlparse import parse_qs, urlparse | |
from wave import open | |
from twisted.internet import reactor | |
from twisted.web.server import Site | |
from twisted.web.resource import Resource | |
from twisted.web.static import File | |
# | |
#Grab arduino that controls the lights to write serial to | |
# |