@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 42 lines 1.45 KB
Raw
1 import type * as polly from "@distilled.cloud/aws/polly";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `polly:SynthesizeSpeech` — synthesize UTF-8 plain
7 * text or SSML into a stream of audio bytes.
8 *
9 * Polly is a pure pay-per-call service with no resource to manage: the
10 * binding takes no arguments and grants the function
11 * `polly:SynthesizeSpeech`. The response `AudioStream` is a byte `Stream`
12 * of the encoded audio (raw distilled types, no marshalling). Provide the
13 * implementation with `Effect.provide(AWS.Polly.SynthesizeSpeechHttp)`.
14 *
15 * ### Synthesizing Speech
16 * **Example:** Synthesize Text to MP3 Bytes
17 * ```typescript
18 * // init
19 * const synthesizeSpeech = yield* AWS.Polly.SynthesizeSpeech();
20 *
21 * // runtime — AudioStream is a byte Stream of the encoded audio
22 * const result = yield* synthesizeSpeech({
23 * Engine: "neural",
24 * OutputFormat: "mp3",
25 * VoiceId: "Joanna",
26 * Text: "Hello from Alchemy.",
27 * });
28 * const chunks = yield* Stream.runCollect(result.AudioStream!);
29 * ```
30 *
31 * @binding
32 */
33 export interface SynthesizeSpeech extends Binding.Service<
34 SynthesizeSpeech,
35 "AWS.Polly.SynthesizeSpeech",
36 () => Effect.Effect<
37 (
38 request: polly.SynthesizeSpeechInput,
39 ) => Effect.Effect<polly.SynthesizeSpeechOutput, polly.SynthesizeSpeechError>
40 >
41 > {}
42 export const SynthesizeSpeech = Binding.Service<SynthesizeSpeech>("AWS.Polly.SynthesizeSpeech");