Skip to content

Instantly share code, notes, and snippets.

View malceore's full-sized avatar

Brandon T. Wood malceore

View GitHub Profile
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
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")
#!/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
@malceore
malceore / serial test for relays
Created September 4, 2017 22:23
run this to confiugre globals for real program gist
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);
@malceore
malceore / serial program for promicro
Created September 4, 2017 22:20
A serial program that listens for input on teh serial and flips gpio/relays automatically.
// 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);
@malceore
malceore / twisted webserver
Created September 4, 2017 22:19
python for webserver that controls lights using serial to write to arduino
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
#