///
import { Readable } from 'node:stream';
import { z } from 'zod';
import { TextToSpeechClient } from '@google-cloud/text-to-speech';
import { cloud_text_to_speech } from '@jackdbd/zod-schemas/gcp';
export declare const audioExtension: (audioEncoding: cloud_text_to_speech.AudioEncoding) => "mp3" | "alaw" | "l16" | "mulaw" | "opus" | "wav";
export declare const synthesis_config: z.ZodObject<{
/**
* Encoding for the generated audio file.
*/
audioEncoding: z.ZodUnion<[z.ZodLiteral<"ALAW">, z.ZodLiteral<"AUDIO_ENCODING_UNSPECIFIED">, z.ZodLiteral<"LINEAR16">, z.ZodLiteral<"MP3">, z.ZodLiteral<"MULAW">, z.ZodLiteral<"OGG_OPUS">]>;
/**
* Voice to use for text-to-speech synthesis.
*
* @see [cloud.google.com - Voices supported by the Speech-to-Text API](https://cloud.google.com/text-to-speech/docs/voices)
* @see [cloud.google.com - Different voices might have different prices](https://cloud.google.com/text-to-speech/pricing)
*/
voiceName: z.ZodString;
}, "strip", z.ZodTypeAny, {
audioEncoding: "ALAW" | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MP3" | "MULAW" | "OGG_OPUS";
voiceName: string;
}, {
audioEncoding: "ALAW" | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MP3" | "MULAW" | "OGG_OPUS";
voiceName: string;
}>;
export type SynthesisConfig = z.input;
export declare const synthesize_config: z.ZodObject<{
/**
* Text to synthesize into speech using the Google Cloud Text-to-Speech API.
*
* @remarks
* Character limit for the Google Cloud Text-to-Speech API: 5000 characters
*/
text: z.ZodTypeAny;
}, "strip", z.ZodTypeAny, {
text?: any;
}, {
text?: any;
}>;
/**
* Configuration for the Google Cloud Text-to-Speech API.
*
* @see [cloud.google.com - Cloud Text-to-Speech API Reference](https://cloud.google.com/text-to-speech/docs/apis)
*/
export type SynthesizeConfig = z.input;
/**
* Synthesizes text into speech using the Google Cloud Text-to-Speech API.
*/
export declare const synthesize: (client: TextToSpeechClient, cfg: SynthesisConfig, text: string) => Promise<{
error: Error;
value?: undefined;
} | {
value: Readable;
error?: undefined;
}>;
export declare const auth_options: z.ZodObject<{
credentials: z.ZodOptional;
private_key: z.ZodString;
}, "strip", z.ZodTypeAny, {
client_email: string;
private_key: string;
}, {
client_email: string;
private_key: string;
}>>;
keyFilename: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
credentials?: {
client_email: string;
private_key: string;
} | undefined;
keyFilename?: string | undefined;
}, {
credentials?: {
client_email: string;
private_key: string;
} | undefined;
keyFilename?: string | undefined;
}>;
export type AuthOptions = z.input;
export declare const client_config: z.ZodObject;
private_key: z.ZodString;
}, "strip", z.ZodTypeAny, {
client_email: string;
private_key: string;
}, {
client_email: string;
private_key: string;
}>>;
keyFilename: z.ZodOptional>;
}, {
/**
* Encoding for the generated audio file.
*/
audioEncoding: z.ZodUnion<[z.ZodLiteral<"ALAW">, z.ZodLiteral<"AUDIO_ENCODING_UNSPECIFIED">, z.ZodLiteral<"LINEAR16">, z.ZodLiteral<"MP3">, z.ZodLiteral<"MULAW">, z.ZodLiteral<"OGG_OPUS">]>;
/**
* Voice to use for text-to-speech synthesis.
*
* @see [cloud.google.com - Voices supported by the Speech-to-Text API](https://cloud.google.com/text-to-speech/docs/voices)
* @see [cloud.google.com - Different voices might have different prices](https://cloud.google.com/text-to-speech/pricing)
*/
voiceName: z.ZodString;
}>, "strip", z.ZodTypeAny, {
audioEncoding: "ALAW" | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MP3" | "MULAW" | "OGG_OPUS";
voiceName: string;
credentials?: {
client_email: string;
private_key: string;
} | undefined;
keyFilename?: string | undefined;
}, {
audioEncoding: "ALAW" | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MP3" | "MULAW" | "OGG_OPUS";
voiceName: string;
credentials?: {
client_email: string;
private_key: string;
} | undefined;
keyFilename?: string | undefined;
}>;
export type ClientConfig = z.input;
/**
* Client for the Google Cloud Text-to-Speech API.
*/
export declare const defClient: (config: ClientConfig) => {
config: {
audioEncoding: "ALAW" | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MP3" | "MULAW" | "OGG_OPUS";
voiceName: string;
};
extension: string;
synthesize: (text: string) => Promise<{
error: Error;
value?: undefined;
} | {
value: Readable;
error?: undefined;
}>;
};
//# sourceMappingURL=gcp-text-to-speech.d.ts.map