Skip to content

Instantly share code, notes, and snippets.

View rashaabdulrazzak's full-sized avatar
🏠
Working from home

Rasha rashaabdulrazzak

🏠
Working from home
View GitHub Profile
@rashaabdulrazzak
rashaabdulrazzak / longfiletranscribe.js
Last active January 9, 2023 16:25
transcribe file located in cloud
// Imports the Google Cloud client library
const speech = require('@google-cloud/speech');
// Creates a client
const client = new speech.SpeechClient();
// const gcsUri = 'gs://my-bucket/audio.raw';
// const encoding = 'Encoding of the audio file, e.g. LINEAR16';
// const sampleRateHertz = 16000;
// const languageCode = 'BCP-47 language code, e.g. en-US';
@rashaabdulrazzak
rashaabdulrazzak / localfile.js
Last active May 29, 2021 08:49
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')

‫ الكتابة بالعربي Arabic

الكتابة بالعربي Arabic