1.2.0 • Published 2 years ago
@nospoon/text-to-speech v1.2.0
Google Cloud Text to Speech
Install
npm i @nospoon/text-to-speech
Usage
Serverless Function
// /pages/api/xxx
import { handler } from '@nospoon/text-to-speech/build/server';
export default handler;
Client
import { tts } from '@nospoon/text-to-speech';
const { audioContent } = await tts('/api/xxx', content);
const player = new Audio(audioContent);
player.play();