Skip to content

Instantly share code, notes, and snippets.

View akramhussein's full-sized avatar

Akram Hussein akramhussein

View GitHub Profile
@akramhussein
akramhussein / gist:88192f612b4e485bb34c63da992959b7
Created September 25, 2016 09:29
Get list of images from Digital Ocean
export DIGITAL_OCEAN_TOKEN=''
curl -X GET --silent "https://api.digitalocean.com/v2/images?per_page=999" -H "Authorization: Bearer $DIGITAL_OCEAN_TOKEN"
@akramhussein
akramhussein / always_listen.py
Created October 25, 2017 10:19
Snips.ai - always listen MQTT app
import json
import paho.mqtt.client as mqtt
# MQTT client to connect to the bus
mqtt_client = mqtt.Client()
def on_connect(client, userdata, flags, rc):
print('Connected')
mqtt_client.subscribe('#') # subscribe to all messages
mqtt_client.publish('hermes/asr/toggleOn') # Start recording audio
@akramhussein
akramhussein / GoogleSpeechToTextStreamingTap.swift
Created December 1, 2017 19:03
AudioKit Tap to convert microphone data for Google Speech-to-Text API
open class GoogleSpeechToTextStreamingTap {
internal var converter: AVAudioConverter!
@objc public init(_ input: AKNode?, sampleRate: Double = 16000.0) {
let format = AVAudioFormat(commonFormat: AVAudioCommonFormat.pcmFormatInt16, sampleRate: sampleRate, channels: 1, interleaved: false)!
self.converter = AVAudioConverter(from: AudioKit.format, to: format)
self.converter?.sampleRateConverterAlgorithm = AVSampleRateConverterAlgorithm_Normal
@akramhussein
akramhussein / README.md
Last active October 13, 2023 20:24
Installing SPM12 on Apple Silicon (macOS)

Instructions

These instructions are for installing and running SPM12 (standalone) on macOS with Apple Silicon.

Installation

SPM12

  1. Download SPM12 (standalone) here