Skip to content

Instantly share code, notes, and snippets.

View forslund's full-sized avatar
🌙

Åke forslund

🌙
View GitHub Profile
{
"max_allowed_core_version": 21.2,
"_server": {
"url": "https://api.mycroft-test.net"
},
"_lang": "sv-se",
"listener": {
"_recording_timeout_with_silence": 50,
"_recording_timeout": 100,
"_wake_word": "blueberry",
import re
import time
words = [
'where',
'which',
'when',
'what',
'that',
'will',
import time
import wave
import speech_recognition as sr
frames = []
microphone = sr.Microphone()
with microphone as source:
import sys
from threading import Event
from mycroft.configuration import Configuration
from mycroft.messagebus.client import MessageBusClient
from mycroft.util import (
create_echo_function,
create_daemon,
reset_sigint_handler,
wait_for_exit_signal
@forslund
forslund / setup.py
Created August 6, 2020 07:53
Mycroft Plugin setup template
#!/usr/bin/env python3
from os.path import join, abspath, dirname, exists
from setuptools import setup
"""Template for mycroft plugin setup.py.
Fill in constants below and change the setup metadata to suite your module.
"""
PLUGIN_TYPE = '' # tts, stt or audioservice
rom mycroft_bus_client import MessageBusClient, Message
print('Setting up client to connect to a local mycroft instance')
client = MessageBusClient()
def print_listening(message):
print('Mycroft is listening')
def print_not_listening(message):
@forslund
forslund / librespot-dev.sh
Last active November 10, 2020 09:23
Building deb package for librespot
# Add deb-src entry for your distribution
sudo echo "deb-src http://ports.ubuntu.com/ubuntu-ports focal main restricted multiverse universe" >> /etc/apt/sources.list
sudo apt-get update
# Install pre-requisites
sudo apt-get build-dep -y cargo
sudo apt-get install -y libssl-dev libcurl4-gnutls-dev quilt
# Install cargo-deb to build debin packages through cargo
cargo install cargo-deb
@forslund
forslund / build.sh
Last active February 1, 2021 23:50
Example of Building Mark-2 packages
# General prerequisites:
sudo apt-get install -y debhelper build-essential fakeroot
# Clone package
git clone https://github.com/mycroft-packaging/mycroft-gui-mark-2 -b focal
cd mycroft-gui-mark-2
# Clone source
git clone https://github.com/mycroftai/mycroft-gui-mark-2
cp -r debian mycroft-gui-mark-2
FROM ubuntu:xenial as builder
# Grab dependencies
RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes \
curl \
jq \
squashfs-tools
# Grab the core snap (for backwards compatibility) from the stable channel and
# unpack it in the proper place.
@forslund
forslund / snapcraft.yaml
Last active March 24, 2020 07:36
precise-snap
name: mycroft-precise
version: 0.3.1
summary: Mycroft Precise
description: Mycroft Precise, a wake word spotter.
base: core18
confinement: strict
build-packages: [python3-dev, python3-setuptools, libtool, libffi-dev, libssl-dev, autoconf, build-essential]
parts:
alsa-mixin:
after: []