Skip to content

Instantly share code, notes, and snippets.

View themmyloluwaa's full-sized avatar

Temiloluwa Philip Ojo themmyloluwaa

View GitHub Profile
@qtangs
qtangs / streaming_tts_using_google.ts
Created August 27, 2024 01:56
Google Cloud TTS Streaming
const textToSpeech = require('@google-cloud/text-to-speech');
const fs = require('fs');
async function streamTextToSpeech(texts: string[]) {
const client = new textToSpeech.TextToSpeechClient();
const ttsStream = client.streamingSynthesize();
// Write the response to a file, replace with your desired output stream