Skip to content

Instantly share code, notes, and snippets.

View KTRosenberg's full-sized avatar

Karl Toby Rosenberg KTRosenberg

  • New York University
View GitHub Profile
@KTRosenberg
KTRosenberg / GoogleSpeechToTextStreamingTap.swift
Created February 4, 2021 05:08 — forked from akramhussein/GoogleSpeechToTextStreamingTap.swift
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
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;