export type GetApiV1TtsLyraVoicesSampleIdArgs = {id: string}; export type GetApiV1TtsLyraVoicesSampleIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Voice Sample Audio * * GET /v1/tts/lyra/voices/sample/{id} */ export const getApiV1TtsLyraVoicesSampleId = async (args: GetApiV1TtsLyraVoicesSampleIdArgs, options?: GetApiV1TtsLyraVoicesSampleIdOptions) => { const {baseUrl = "https://genaipro.io/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "audio/*") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/tts/lyra/voices/sample/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };