Skip to content

Instantly share code, notes, and snippets.

View zerolethanh's full-sized avatar
😀

LE VAN THANH zerolethanh

😀
View GitHub Profile
@zerolethanh
zerolethanh / streaming_tts_using_google.ts
Created December 21, 2024 06:59 — forked from qtangs/streaming_tts_using_google.ts
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