# Speechify The Speechify voice implementation in Mastra provides text-to-speech capabilities using Speechify's API. ## Usage Example ```typescript import { SpeechifyVoice } from "@mastra/voice-speechify"; // Initialize with default configuration (uses SPEECHIFY_API_KEY environment variable) const voice = new SpeechifyVoice(); // Initialize with custom configuration const voice = new SpeechifyVoice({ speechModel: { name: "simba-english", apiKey: "your-api-key", }, speaker: "george", // Default voice }); // Convert text to speech const audioStream = await voice.speak("Hello, world!", { speaker: "henry", // Override default voice }); ``` ## Constructor Parameters **speechModel?:** (`SpeechifyConfig`): Configuration for text-to-speech functionality (Default: `{ name: 'simba-english' }`) **speaker?:** (`SpeechifyVoiceId`): Default voice ID to use for speech synthesis (Default: `'george'`) ### SpeechifyConfig **name?:** (`VoiceModelName`): The Speechify model to use (Default: `'simba-english'`) **apiKey?:** (`string`): Speechify API key. Falls back to SPEECHIFY\_API\_KEY environment variable ## Methods ### speak() Converts text to speech using the configured speech model and voice. **input:** (`string | NodeJS.ReadableStream`): Text to convert to speech. If a stream is provided, it will be converted to text first. **options.speaker?:** (`string`): Override the default speaker for this request (Default: `Constructor's speaker value`) **options.model?:** (`VoiceModelName`): Override the default model for this request (Default: `Constructor's model value`) Returns: `Promise` ### getSpeakers() Returns an array of available voice options, where each node contains: **voiceId:** (`string`): Unique identifier for the voice **name:** (`string`): Display name of the voice **language:** (`string`): Language code for the voice **gender:** (`string`): Gender of the voice ### listen() This method is not supported by Speechify and will throw an error. Speechify does not provide speech-to-text functionality. ## Notes - Speechify requires an API key for authentication - The default model is 'simba-english' - Speech-to-text functionality is not supported - Additional audio stream options can be passed through the speak() method's options parameter