Back to Mastra

Voice | v1 Migration Guide

docs/src/content/en/guides/migrations/upgrade-to-v1/voice.mdx

2025-12-18899 B
Original Source

Voice

Voice packages have been renamed from speech to voice with updated class names and API methods.

Changed

Voice configuration property names

Voice configuration properties have been renamed for consistency. speakProvider is now output, listenProvider is now input, and realtimeProvider is now realtime. This change provides more intuitive property names.

To migrate, update configuration property names when configuring agents with voice capabilities.

diff
  const agent = new Agent({
    voice: {
-     speakProvider: murfVoice,
-     listenProvider: deepgramVoice,
-     realtimeProvider: openaiRealtime,
+     output: murfVoice,
+     input: deepgramVoice,
+     realtime: openaiRealtime,
    },
  });

:::tip[Codemod]

You can use Mastra's codemod CLI to update your code automatically:

bash
npx @mastra/codemod@latest v1/voice-property-names .

:::