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

listVoices.md

46 lines1022 Bytes

1---
2id: listVoices
3title: listVoices
4---
5​
6```ts
7function listVoices<TAdapter>(options): Promise<ListVoicesResult>;
8```
9​
10Defined in: packages/ai/src/activities/generateSpeech/index.ts:453
11​
12List the voices an account can pass to `generateSpeech()`.
13​
14Only providers with a per-account catalog implement this. A provider whose
15voices are a fixed list publishes that list as a const in its package, so
16import it from there rather than calling this.
17​
18## Type Parameters
19​
20### TAdapter
21​
22`TAdapter` *extends* [`TTSAdapter`](../interfaces/TTSAdapter.md)\<`string`, `TTSProviderOptions`\<`TAdapter`\>\>
23​
24## Parameters
25​
26### options
27​
28`ListVoicesActivityOptions`\<`TAdapter`\>
29​
30## Returns
31​
32`Promise`\<[`ListVoicesResult`](../interfaces/ListVoicesResult.md)\>
33​
34## Example
35​
36**Find the voices you created**
37​
38```ts
39import { listVoices } from '@tanstack/ai'
40import { elevenlabsSpeech } from '@tanstack/ai-elevenlabs'
41​
42const { voices } = await listVoices({
43 adapter: elevenlabsSpeech('eleven_v4'),
44 origins: ['generated', 'cloned'],
45})
46```