Skip to content

Instantly share code, notes, and snippets.

View abdulajet's full-sized avatar
🌴
On vacation

Abdulhakim Ajetunmobi abdulajet

🌴
On vacation
View GitHub Profile
import { vcr, Voice, State } from "@vonage/vcr-sdk";
import { Vonage } from "@vonage/server-sdk";
import express from "express";
import OpenAI from 'openai';
import pug from 'pug';
import fs from 'fs';
const app = express();
const port = process.env.VCR_PORT;
#!/bin/bash
# Ensure a parent directory is specified
if [ -z "$1" ]; then
echo "Usage: $0 <parent_directory>"
exit 1
fi
parent_dir="$1"
func startAnalysingAudio() {
let inputNode = audioEngine.inputNode
let bus = 0
inputNode.installTap(onBus: bus, bufferSize: 2048, format: inputNode.inputFormat(forBus: bus)) { (buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in
self.session.matchStreamingBuffer(buffer, at: time)
}
audioEngine.prepare()
try! audioEngine.start()
}