Skip to content

Instantly share code, notes, and snippets.

@rashaabdulrazzak
Last active May 29, 2021 08:49
Show Gist options
  • Save rashaabdulrazzak/c80223dc561ea23f7f611ad40c5480be to your computer and use it in GitHub Desktop.
Save rashaabdulrazzak/c80223dc561ea23f7f611ad40c5480be to your computer and use it in GitHub Desktop.
local file transcript
// require fs to be able to read the file
const fs = require('fs')
// define the path where the file located
const filename = './resources/test.wav'
// the changes below should inclouded inside quickstart function
// read the file
const file = fs.readFileSync(filename)
// convert it to base 64
const audioBytes = file.toString('base64')
const audio = {
content: audioBytes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment