@jackdbd/eleventy-plugin-text-to-speech
Version:
Eleventy plugin for the Google Cloud Text-to-Speech API
33 lines • 1.04 kB
TypeScript
import type { TextToSpeechClient } from '@google-cloud/text-to-speech';
import type { AudioEncoding } from './types';
import type { Writer } from './writers.js';
interface Config {
audioEncodings: AudioEncoding[];
cacheExpiration: string;
outputPath: string;
text: string;
textToSpeechClient: TextToSpeechClient;
voice: string;
writer: Writer;
}
/**
* Synthesize a `text` into audio assets using the Cloud Text-to-Speech API.
*
* Generate as many audio buffers as the specified `audioEncodings`,
* using the specified `voice`.
*
* Write all generated audio assets using the specified `writer`.
*/
export declare const audioAssetsFromText: ({ audioEncodings, cacheExpiration, outputPath, text, textToSpeechClient, voice, writer }: Config) => Promise<{
contentHash: string;
hrefs: string[];
warnings: string[];
error?: undefined;
} | {
contentHash: string;
error: Error;
hrefs: string[];
warnings: string[];
}>;
export {};
//# sourceMappingURL=audio-assets-from-text.d.ts.map