Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

TTSResult.md

130 lines2.5 KB

1---
2id: TTSResult
3title: TTSResult
4---
5​
6Defined in: [packages/ai/src/types.ts:2598](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2598)
7​
8Result of text-to-speech generation.
9​
10## Properties
11​
12### alignment?
13​
14```ts
15optional alignment?: TTSAlignment;
16```
17​
18Defined in: [packages/ai/src/types.ts:2613](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2613)
19​
20Character- or word-level timings, present when `timestamps: true` was
21requested. Use this rather than `duration` to find where *speech* ends.
22​
23***
24​
25### artifacts?
26​
27```ts
28optional artifacts?: PersistedArtifactRef[];
29```
30​
31Defined in: [packages/ai/src/types.ts:2624](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2624)
32​
33Persisted artifact references for generated assets, when available
34​
35***
36​
37### audio
38​
39```ts
40audio: string;
41```
42​
43Defined in: [packages/ai/src/types.ts:2604](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2604)
44​
45Base64-encoded audio data
46​
47***
48​
49### contentType?
50​
51```ts
52optional contentType?: string;
53```
54​
55Defined in: [packages/ai/src/types.ts:2620](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2620)
56​
57Content type of the audio (e.g., 'audio/mp3')
58​
59***
60​
61### duration?
62​
63```ts
64optional duration?: number;
65```
66​
67Defined in: [packages/ai/src/types.ts:2608](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2608)
68​
69Duration of the audio file in seconds, if available
70​
71***
72​
73### format
74​
75```ts
76format: string;
77```
78​
79Defined in: [packages/ai/src/types.ts:2606](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2606)
80​
81Audio format of the generated audio
82​
83***
84​
85### id
86​
87```ts
88id: string;
89```
90​
91Defined in: [packages/ai/src/types.ts:2600](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2600)
92​
93Unique identifier for the generation
94​
95***
96​
97### model
98​
99```ts
100model: string;
101```
102​
103Defined in: [packages/ai/src/types.ts:2602](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2602)
104​
105Model used for generation
106​
107***
108​
109### segments?
110​
111```ts
112optional segments?: TTSSegment[];
113```
114​
115Defined in: [packages/ai/src/types.ts:2618](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2618)
116​
117Per-turn (or per-utterance) spans of the audio, present when
118`timestamps: true` was requested and the provider reports segmentation.
119​
120***
121​
122### usage?
123​
124```ts
125optional usage?: TokenUsage<ProviderUsageDetails>;
126```
127​
128Defined in: [packages/ai/src/types.ts:2622](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2622)
129​
130Token usage information (if provided by the adapter)