@mastra/voice-openai-realtime 0.13.3 → 0.13.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/voice-openai-realtime
2
2
 
3
+ ## 0.13.4-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`6789ab4`](https://github.com/mastra-ai/mastra/commit/6789ab4191ddcd32a932898b360b191e80cee1a9)]:
8
+ - @mastra/schema-compat@1.3.4-alpha.0
9
+
3
10
  ## 0.13.3
4
11
 
5
12
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-voice-openai-realtime
3
3
  description: Documentation for @mastra/voice-openai-realtime. Use when working with @mastra/voice-openai-realtime APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/voice-openai-realtime"
6
- version: "0.13.3"
6
+ version: "0.13.4-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -16,7 +16,6 @@ Read the individual reference documents for detailed explanations and code examp
16
16
 
17
17
  ### Docs
18
18
 
19
- - [Voice](references/docs-agents-adding-voice.md) - Learn how to add voice capabilities to your Mastra agents for text-to-speech and speech-to-text interactions.
20
19
  - [Voice in Mastra](references/docs-voice-overview.md) - Overview of voice capabilities in Mastra, including text-to-speech, speech-to-text, and real-time speech-to-speech interactions.
21
20
  - [Speech-to-Speech capabilities in Mastra](references/docs-voice-speech-to-speech.md) - Overview of speech-to-speech capabilities in Mastra, including real-time interactions and event-driven architecture.
22
21
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.13.3",
2
+ "version": "0.13.4-alpha.0",
3
3
  "package": "@mastra/voice-openai-realtime",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -4,9 +4,9 @@
4
4
 
5
5
  Mastra's Voice system provides a unified interface for voice interactions, enabling text-to-speech (TTS), speech-to-text (STT), and real-time speech-to-speech (STS) capabilities in your applications.
6
6
 
7
- ## Adding voice to agents
7
+ ## Add voice to agents
8
8
 
9
- To learn how to integrate voice capabilities into your agents, check out the [Adding Voice to Agents](https://mastra.ai/docs/agents/adding-voice) documentation. This section covers how to use both single and multiple voice providers, as well as real-time interactions.
9
+ Pass a voice provider to an agent with the `voice` property. The same property supports text-to-speech (TTS), speech-to-text (STT), and real-time speech-to-speech (STS), depending on the provider you configure.
10
10
 
11
11
  ```typescript
12
12
  import { Agent } from '@mastra/core/agent'
@@ -1139,7 +1139,7 @@ const voiceAgent = new Agent({
1139
1139
  })
1140
1140
  ```
1141
1141
 
1142
- ### Using Multiple Voice Providers
1142
+ ### Using multiple voice providers
1143
1143
 
1144
1144
  This example demonstrates how to create and use two different voice providers in Mastra: OpenAI for speech-to-text (STT) and PlayAI for text-to-speech (TTS).
1145
1145
 
@@ -54,7 +54,87 @@ const micStream = getMicrophoneStream()
54
54
  await agent.voice.send(micStream)
55
55
  ```
56
56
 
57
- For integrating Speech-to-Speech capabilities with agents, refer to the [Adding Voice to Agents](https://mastra.ai/docs/agents/adding-voice) documentation.
57
+ For a broader overview of voice providers on agents, see [Voice in Mastra](https://mastra.ai/docs/voice/overview).
58
+
59
+ ## Use tools in realtime sessions
60
+
61
+ Realtime voice providers can use tools configured on the agent. Add the tools to the `Agent` definition, then connect and send audio through the voice provider:
62
+
63
+ ```typescript
64
+ import { Agent } from '@mastra/core/agent'
65
+ import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime'
66
+ import { calculate, search } from '../tools'
67
+
68
+ export const agent = new Agent({
69
+ id: 'speech-to-speech-agent',
70
+ name: 'Speech-to-Speech Agent',
71
+ instructions: 'You are a helpful assistant with speech-to-speech capabilities.',
72
+ model: 'openai/gpt-5.5',
73
+ tools: {
74
+ search,
75
+ calculate,
76
+ },
77
+ voice: new OpenAIRealtimeVoice(),
78
+ })
79
+ ```
80
+
81
+ ## Listen for realtime events
82
+
83
+ Realtime voice providers emit events you can use to update your UI, play assistant audio, log transcriptions, and handle errors:
84
+
85
+ ```typescript
86
+ agent.voice.on('speaking', ({ audio }) => {
87
+ playAudio(audio)
88
+ })
89
+
90
+ agent.voice.on('writing', ({ text, role }) => {
91
+ console.log(`${role}: ${text}`)
92
+ })
93
+
94
+ agent.voice.on('error', error => {
95
+ console.error('Voice error:', error)
96
+ })
97
+ ```
98
+
99
+ Event names and payloads vary by provider. Check the provider section below or the provider reference for the full event list.
100
+
101
+ ## Per-session voice instances
102
+
103
+ A static `voice` instance is shared across every request. This works for one-shot text-to-speech, but real-time and speech-to-speech providers store session state such as the WebSocket connection, tools, instructions, and request context. If one agent handles several live sessions at once, a shared instance can let one session overwrite another session's state.
104
+
105
+ Provide `voice` as a resolver when each live session needs its own voice instance. Mastra runs the resolver on each `getVoice()` call and returns a fresh instance for that request context:
106
+
107
+ ```typescript
108
+ import { Agent } from '@mastra/core/agent'
109
+ import { RequestContext } from '@mastra/core/request-context'
110
+ import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime'
111
+
112
+ export const agent = new Agent({
113
+ id: 'support-line',
114
+ name: 'Support Line',
115
+ instructions: ({ requestContext }) => `Help user ${requestContext.get('user')}.`,
116
+ model: 'openai/gpt-5.5',
117
+ voice: ({ requestContext }) =>
118
+ new OpenAIRealtimeVoice({
119
+ apiKey: requestContext.get('apiKey'),
120
+ }),
121
+ })
122
+
123
+ const requestContext = new RequestContext()
124
+ requestContext.set('user', 'user-123')
125
+ requestContext.set('apiKey', process.env.OPENAI_API_KEY)
126
+
127
+ const voice = await agent.getVoice({ requestContext })
128
+ await voice.connect()
129
+ ```
130
+
131
+ When you use a resolver:
132
+
133
+ - Each call to `getVoice()` returns a new instance, so concurrent sessions don't share state.
134
+ - Mastra doesn't add tools or instructions to a resolver instance. Configure them inside the resolver or on the provider.
135
+ - You own the returned instance lifecycle, so call `disconnect()` or `close()` when the session ends.
136
+
137
+ The `agent.voice` getter has no request context, so it throws when `voice` is a resolver. Use `agent.getVoice({ requestContext })` instead.
58
138
 
59
139
  ## Google Gemini Live (Realtime)
60
140
 
@@ -50,7 +50,7 @@ voice.on('error', ({ message, code, details }) => {
50
50
 
51
51
  ## Parameters
52
52
 
53
- **event** (`string`): Name of the event to listen for. See the \[Voice Events]\(./voice.events) documentation for a list of available events.
53
+ **event** (`string`): Name of the event to listen for. See the Voice Events documentation for a list of available events.
54
54
 
55
55
  **callback** (`function`): Callback function that will be called when the event occurs. The callback signature depends on the specific event.
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-openai-realtime",
3
- "version": "0.13.3",
3
+ "version": "0.13.4-alpha.0",
4
4
  "description": "Mastra OpenAI Realtime API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,22 +26,22 @@
26
26
  "dependencies": {
27
27
  "openai-realtime-api": "^1.0.8",
28
28
  "ws": "^8.21.0",
29
- "@mastra/schema-compat": "1.3.3"
29
+ "@mastra/schema-compat": "1.3.4-alpha.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "22.19.21",
33
33
  "@types/ws": "^8.18.1",
34
- "@vitest/coverage-v8": "4.1.8",
35
- "@vitest/ui": "4.1.8",
34
+ "@vitest/coverage-v8": "4.1.9",
35
+ "@vitest/ui": "4.1.9",
36
36
  "eslint": "^10.4.1",
37
37
  "tsup": "^8.5.1",
38
38
  "tsx": "^4.22.4",
39
39
  "typescript": "^6.0.3",
40
- "vitest": "4.1.8",
40
+ "vitest": "4.1.9",
41
41
  "zod": "^4.4.3",
42
- "@internal/lint": "0.0.111",
43
- "@internal/types-builder": "0.0.86",
44
- "@internal/voice": "0.0.11"
42
+ "@internal/types-builder": "0.0.88",
43
+ "@internal/lint": "0.0.113",
44
+ "@internal/voice": "0.0.13"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "zod": "^3.25.0 || ^4.0.0"
@@ -1,383 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Voice
4
-
5
- Mastra agents can be enhanced with voice capabilities, allowing them to speak responses and listen to user input. You can configure an agent to use either a single voice provider or combine multiple providers for different operations.
6
-
7
- ## Basic usage
8
-
9
- The simplest way to add voice to an agent is to use a single provider for both speaking and listening:
10
-
11
- ```typescript
12
- import { createReadStream } from 'fs'
13
- import path from 'path'
14
- import { Agent } from '@mastra/core/agent'
15
- import { OpenAIVoice } from '@mastra/voice-openai'
16
-
17
- // Initialize the voice provider with default settings
18
- const voice = new OpenAIVoice()
19
-
20
- // Create an agent with voice capabilities
21
- export const agent = new Agent({
22
- id: 'voice-agent',
23
- name: 'Voice Agent',
24
- instructions: `You are a helpful assistant with both STT and TTS capabilities.`,
25
- model: 'openai/gpt-5.5',
26
- voice,
27
- })
28
-
29
- // The agent can now use voice for interaction
30
- const audioStream = await agent.voice.speak("Hello, I'm your AI assistant!", {
31
- filetype: 'm4a',
32
- })
33
-
34
- playAudio(audioStream!)
35
-
36
- try {
37
- const transcription = await agent.voice.listen(audioStream)
38
- console.log(transcription)
39
- } catch (error) {
40
- console.error('Error transcribing audio:', error)
41
- }
42
- ```
43
-
44
- ## Working with audio streams
45
-
46
- The `speak()` and `listen()` methods work with Node.js streams. Here's how to save and load audio files:
47
-
48
- ### Saving Speech Output
49
-
50
- The `speak` method returns a stream that you can pipe to a file or speaker.
51
-
52
- ```typescript
53
- import { createWriteStream } from 'fs'
54
- import path from 'path'
55
-
56
- // Generate speech and save to file
57
- const audio = await agent.voice.speak('Hello, World!')
58
- const filePath = path.join(process.cwd(), 'agent.mp3')
59
- const writer = createWriteStream(filePath)
60
-
61
- audio.pipe(writer)
62
-
63
- await new Promise<void>((resolve, reject) => {
64
- writer.on('finish', () => resolve())
65
- writer.on('error', reject)
66
- })
67
- ```
68
-
69
- ### Transcribing Audio Input
70
-
71
- The `listen` method expects a stream of audio data from a microphone or file.
72
-
73
- ```typescript
74
- import { createReadStream } from 'fs'
75
- import path from 'path'
76
-
77
- // Read audio file and transcribe
78
- const audioFilePath = path.join(process.cwd(), '/agent.m4a')
79
- const audioStream = createReadStream(audioFilePath)
80
-
81
- try {
82
- console.log('Transcribing audio file...')
83
- const transcription = await agent.voice.listen(audioStream, {
84
- filetype: 'm4a',
85
- })
86
- console.log('Transcription:', transcription)
87
- } catch (error) {
88
- console.error('Error transcribing audio:', error)
89
- }
90
- ```
91
-
92
- ## Speech-to-speech voice interactions
93
-
94
- For more dynamic and interactive voice experiences, you can use real-time voice providers that support speech-to-speech capabilities:
95
-
96
- ```typescript
97
- import { Agent } from '@mastra/core/agent'
98
- import { getMicrophoneStream } from '@mastra/node-audio'
99
- import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime'
100
- import { search, calculate } from '../tools'
101
-
102
- // Initialize the realtime voice provider
103
- const voice = new OpenAIRealtimeVoice({
104
- apiKey: process.env.OPENAI_API_KEY,
105
- model: 'gpt-5.1-realtime',
106
- speaker: 'alloy',
107
- })
108
-
109
- // Create an agent with speech-to-speech voice capabilities
110
- export const agent = new Agent({
111
- id: 'speech-to-speech-agent',
112
- name: 'Speech-to-Speech Agent',
113
- instructions: `You are a helpful assistant with speech-to-speech capabilities.`,
114
- model: 'openai/gpt-5.5',
115
- tools: {
116
- // Tools configured on Agent are passed to voice provider
117
- search,
118
- calculate,
119
- },
120
- voice,
121
- })
122
-
123
- // Establish a WebSocket connection
124
- await agent.voice.connect()
125
-
126
- // Start a conversation
127
- agent.voice.speak("Hello, I'm your AI assistant!")
128
-
129
- // Stream audio from a microphone
130
- const microphoneStream = getMicrophoneStream()
131
- agent.voice.send(microphoneStream)
132
-
133
- // When done with the conversation
134
- agent.voice.close()
135
- ```
136
-
137
- ### Per-session voice for concurrent sessions
138
-
139
- A static `voice` instance is shared across every request. For one-shot text-to-speech this is fine, but realtime and speech-to-speech providers store one WebSocket, one set of tools, and one request context per instance. If you deploy a single agent that handles several live sessions at once, a shared instance lets one session overwrite another session's tools, instructions, and request context.
140
-
141
- To give each session its own voice, provide `voice` as a resolver. Mastra runs the resolver on every `getVoice()` call and returns a fresh, session-owned instance:
142
-
143
- ```typescript
144
- import { Agent } from '@mastra/core/agent'
145
- import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime'
146
-
147
- export const agent = new Agent({
148
- id: 'support-line',
149
- name: 'Support Line',
150
- instructions: ({ requestContext }) => `Help user ${requestContext.get('user')}.`,
151
- model: 'openai/gpt-5.5',
152
- voice: ({ requestContext }) => new OpenAIRealtimeVoice({ apiKey: requestContext.get('apiKey') }),
153
- })
154
-
155
- // Each concurrent session resolves its own voice instance
156
- const voice = await agent.getVoice({ requestContext })
157
- await voice.connect()
158
- ```
159
-
160
- When you use a resolver:
161
-
162
- - Each call to `getVoice()` returns a new instance, so concurrent sessions never share state.
163
- - Mastra doesn't add tools or instructions to a resolver instance. Configure those inside the resolver or on the provider.
164
- - You own the lifecycle of the returned instance, so call `disconnect()` or `close()` when the session ends.
165
-
166
- The `agent.voice` getter has no request context, so it throws when `voice` is a resolver. Use `agent.getVoice({ requestContext })` instead.
167
-
168
- ### Event System
169
-
170
- The realtime voice provider emits several events you can listen for:
171
-
172
- ```typescript
173
- // Listen for speech audio data sent from voice provider
174
- agent.voice.on('speaking', ({ audio }) => {
175
- // audio contains ReadableStream or Int16Array audio data
176
- })
177
-
178
- // Listen for transcribed text sent from both voice provider and user
179
- agent.voice.on('writing', ({ text, role }) => {
180
- console.log(`${role} said: ${text}`)
181
- })
182
-
183
- // Listen for errors
184
- agent.voice.on('error', error => {
185
- console.error('Voice error:', error)
186
- })
187
- ```
188
-
189
- ## Examples
190
-
191
- ### End-to-end voice interaction
192
-
193
- This example demonstrates a voice interaction between two agents. The hybrid voice agent, which uses multiple providers, speaks a question, which is saved as an audio file. The unified voice agent listens to that file, processes the question, generates a response, and speaks it back. Both audio outputs are saved to the `audio` directory.
194
-
195
- The following files are created:
196
-
197
- - **hybrid-question.mp3** – Hybrid agent's spoken question.
198
- - **unified-response.mp3** – Unified agent's spoken response.
199
-
200
- ```typescript
201
- import 'dotenv/config'
202
-
203
- import path from 'path'
204
- import { createReadStream } from 'fs'
205
- import { Agent } from '@mastra/core/agent'
206
- import { CompositeVoice } from '@mastra/core/voice'
207
- import { OpenAIVoice } from '@mastra/voice-openai'
208
- import { Mastra } from '@mastra/core'
209
-
210
- // Saves an audio stream to a file in the audio directory, creating the directory if it doesn't exist.
211
- export const saveAudioToFile = async (
212
- audio: NodeJS.ReadableStream,
213
- filename: string,
214
- ): Promise<void> => {
215
- const audioDir = path.join(process.cwd(), 'audio')
216
- const filePath = path.join(audioDir, filename)
217
-
218
- await fs.promises.mkdir(audioDir, { recursive: true })
219
-
220
- const writer = createWriteStream(filePath)
221
- audio.pipe(writer)
222
- return new Promise((resolve, reject) => {
223
- writer.on('finish', resolve)
224
- writer.on('error', reject)
225
- })
226
- }
227
-
228
- // Saves an audio stream to a file in the audio directory, creating the directory if it doesn't exist.
229
- export const convertToText = async (input: string | NodeJS.ReadableStream): Promise<string> => {
230
- if (typeof input === 'string') {
231
- return input
232
- }
233
-
234
- const chunks: Buffer[] = []
235
- return new Promise((resolve, reject) => {
236
- inputData.on('data', chunk => chunks.push(Buffer.from(chunk)))
237
- inputData.on('error', reject)
238
- inputData.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')))
239
- })
240
- }
241
-
242
- export const hybridVoiceAgent = new Agent({
243
- id: 'hybrid-voice-agent',
244
- name: 'Hybrid Voice Agent',
245
- model: 'openai/gpt-5.5',
246
- instructions: 'You can speak and listen using different providers.',
247
- voice: new CompositeVoice({
248
- input: new OpenAIVoice(),
249
- output: new OpenAIVoice(),
250
- }),
251
- })
252
-
253
- export const unifiedVoiceAgent = new Agent({
254
- id: 'unified-voice-agent',
255
- name: 'Unified Voice Agent',
256
- instructions: 'You are an agent with both STT and TTS capabilities.',
257
- model: 'openai/gpt-5.5',
258
- voice: new OpenAIVoice(),
259
- })
260
-
261
- export const mastra = new Mastra({
262
- agents: { hybridVoiceAgent, unifiedVoiceAgent },
263
- })
264
-
265
- const hybridVoiceAgent = mastra.getAgent('hybridVoiceAgent')
266
- const unifiedVoiceAgent = mastra.getAgent('unifiedVoiceAgent')
267
-
268
- const question = 'What is the meaning of life in one sentence?'
269
-
270
- const hybridSpoken = await hybridVoiceAgent.voice.speak(question)
271
-
272
- await saveAudioToFile(hybridSpoken!, 'hybrid-question.mp3')
273
-
274
- const audioStream = createReadStream(path.join(process.cwd(), 'audio', 'hybrid-question.mp3'))
275
- const unifiedHeard = await unifiedVoiceAgent.voice.listen(audioStream)
276
-
277
- const inputText = await convertToText(unifiedHeard!)
278
-
279
- const unifiedResponse = await unifiedVoiceAgent.generate(inputText)
280
- const unifiedSpoken = await unifiedVoiceAgent.voice.speak(unifiedResponse.text)
281
-
282
- await saveAudioToFile(unifiedSpoken!, 'unified-response.mp3')
283
- ```
284
-
285
- ### Using Multiple Providers
286
-
287
- For more flexibility, you can use different providers for speaking and listening using the CompositeVoice class:
288
-
289
- ```typescript
290
- import { Agent } from '@mastra/core/agent'
291
- import { CompositeVoice } from '@mastra/core/voice'
292
- import { OpenAIVoice } from '@mastra/voice-openai'
293
- import { PlayAIVoice } from '@mastra/voice-playai'
294
-
295
- export const agent = new Agent({
296
- id: 'voice-agent',
297
- name: 'Voice Agent',
298
- instructions: `You are a helpful assistant with both STT and TTS capabilities.`,
299
- model: 'openai/gpt-5.5',
300
-
301
- // Create a composite voice using OpenAI for listening and PlayAI for speaking
302
- voice: new CompositeVoice({
303
- input: new OpenAIVoice(),
304
- output: new PlayAIVoice(),
305
- }),
306
- })
307
- ```
308
-
309
- ### Using AI SDK
310
-
311
- Mastra supports using AI SDK's transcription and speech models directly in `CompositeVoice`, giving you access to a wide range of providers through the AI SDK ecosystem:
312
-
313
- ```typescript
314
- import { Agent } from '@mastra/core/agent'
315
- import { CompositeVoice } from '@mastra/core/voice'
316
- import { openai } from '@ai-sdk/openai'
317
- import { elevenlabs } from '@ai-sdk/elevenlabs'
318
- import { groq } from '@ai-sdk/groq'
319
-
320
- export const agent = new Agent({
321
- id: 'aisdk-voice-agent',
322
- name: 'AI SDK Voice Agent',
323
- instructions: `You are a helpful assistant with voice capabilities.`,
324
- model: 'openai/gpt-5.5',
325
-
326
- // Pass AI SDK models directly to CompositeVoice
327
- voice: new CompositeVoice({
328
- input: openai.transcription('whisper-1'), // AI SDK transcription model
329
- output: elevenlabs.speech('eleven_turbo_v2'), // AI SDK speech model
330
- }),
331
- })
332
-
333
- // Use voice capabilities as usual
334
- const audioStream = await agent.voice.speak('Hello!')
335
- const transcribedText = await agent.voice.listen(audioStream)
336
- ```
337
-
338
- #### Mix and Match Providers
339
-
340
- You can mix AI SDK models with Mastra voice providers:
341
-
342
- ```typescript
343
- import { CompositeVoice } from '@mastra/core/voice'
344
- import { PlayAIVoice } from '@mastra/voice-playai'
345
- import { openai } from '@ai-sdk/openai'
346
-
347
- // Use AI SDK for transcription and Mastra provider for speech
348
- const voice = new CompositeVoice({
349
- input: openai.transcription('whisper-1'), // AI SDK
350
- output: new PlayAIVoice(), // Mastra provider
351
- })
352
- ```
353
-
354
- For the complete list of supported AI SDK providers and their capabilities:
355
-
356
- - [Transcription](https://ai-sdk.dev/docs/providers/openai/transcription)
357
- - [Speech](https://ai-sdk.dev/docs/providers/elevenlabs/speech)
358
-
359
- ## Supported voice providers
360
-
361
- Mastra supports multiple voice providers for text-to-speech (TTS) and speech-to-text (STT) capabilities:
362
-
363
- | Provider | Package | Features | Reference |
364
- | --------------- | ------------------------------- | ----------------------------------------- | ------------------------------------------------------------------ |
365
- | OpenAI | `@mastra/voice-openai` | TTS, STT | [Documentation](https://mastra.ai/reference/voice/openai) |
366
- | OpenAI Realtime | `@mastra/voice-openai-realtime` | Realtime speech-to-speech | [Documentation](https://mastra.ai/reference/voice/openai-realtime) |
367
- | AWS Nova Sonic | `@mastra/voice-aws-nova-sonic` | Realtime speech-to-speech via AWS Bedrock | [Documentation](https://mastra.ai/reference/voice/aws-nova-sonic) |
368
- | ElevenLabs | `@mastra/voice-elevenlabs` | High-quality TTS | [Documentation](https://mastra.ai/reference/voice/elevenlabs) |
369
- | PlayAI | `@mastra/voice-playai` | TTS | [Documentation](https://mastra.ai/reference/voice/playai) |
370
- | Google | `@mastra/voice-google` | TTS, STT | [Documentation](https://mastra.ai/reference/voice/google) |
371
- | Deepgram | `@mastra/voice-deepgram` | STT | [Documentation](https://mastra.ai/reference/voice/deepgram) |
372
- | Murf | `@mastra/voice-murf` | TTS | [Documentation](https://mastra.ai/reference/voice/murf) |
373
- | Speechify | `@mastra/voice-speechify` | TTS | [Documentation](https://mastra.ai/reference/voice/speechify) |
374
- | Sarvam | `@mastra/voice-sarvam` | TTS, STT | [Documentation](https://mastra.ai/reference/voice/sarvam) |
375
- | Azure | `@mastra/voice-azure` | TTS, STT | [Documentation](https://mastra.ai/reference/voice/mastra-voice) |
376
- | Cloudflare | `@mastra/voice-cloudflare` | TTS | [Documentation](https://mastra.ai/reference/voice/mastra-voice) |
377
-
378
- ## Next steps
379
-
380
- - [Voice API Reference](https://mastra.ai/reference/voice/mastra-voice): Detailed API documentation for voice capabilities
381
- - [Text to Speech Examples](https://github.com/mastra-ai/voice-examples/tree/main/text-to-speech): Interactive story generator and other TTS implementations
382
- - [Speech to Text Examples](https://github.com/mastra-ai/voice-examples/tree/main/speech-to-text): Voice memo app and other STT implementations
383
- - [Speech to Speech Examples](https://github.com/mastra-ai/voice-examples/tree/main/speech-to-speech): Real-time voice conversation with call analysis