> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Speechify Mastra の Speechify Voice 実装は、Speechify API を使用した Text-to-Speech 機能を提供します。 ## 使用例 ```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-3.2', apiKey: 'your-api-key', }, speaker: 'harper_32', // Default voice (simba-3.2 serves the curated Simba 3 voices only) }) // Convert text to speech const audioStream = await voice.speak('Hello, world!', { speaker: 'imogen_32', // Override default voice }) ``` ## コンストラクターパラメーター **speechModel** (`SpeechifyConfig`): Text-to-Speech 機能の設定 (Default: `{ name: 'simba-english' }`) **speechModel.name** (`SpeechifyModel`): 使用する Speechify モデル('simba-3.2'、'simba-3.0'、'simba-english'、'simba-multilingual' のいずれか) **speechModel.apiKey** (`string`): Speechify API キー。未指定の場合は SPEECHIFY\_API\_KEY 環境変数を使用します **speaker** (`SpeechifyVoiceId`): 音声合成に使用するデフォルトの Voice ID。Simba 3 モデルでは厳選された Voice セット(harper\_32、imogen\_32 など)だけを利用できます。従来のカタログ Voice(george、henry など)は simba-english と simba-multilingual で使用できます (Default: `'harper_32' for Simba 3 models, otherwise 'george'`) ## メソッド ### `speak()` 設定された音声モデルと Voice を使用してテキストを音声に変換します。 **input** (`string | NodeJS.ReadableStream`): 音声に変換するテキスト。ストリームを指定した場合は、先にテキストへ変換されます。 **options** (`Options`): 設定オプション。 **options.speaker** (`string`): このリクエストでデフォルトの Speaker を上書きします **options.model** (`SpeechifyModel`): このリクエストでデフォルトモデルを上書きします 戻り値:`Promise` ### `getSpeakers()` 使用可能な Voice オプションの配列を返します。各要素には次の値が含まれます。 **voiceId** (`string`): Voice の一意な識別子 **name** (`string`): Voice の表示名 **language** (`string`): Voice の言語コード **gender** (`string`): Voice の性別 ### `listen()` このメソッドは Speechify でサポートされておらず、エラーをスローします。Speechify は Speech-to-Text 機能を提供しません。 ## 注意事項 - Speechify の認証には API キーが必要です - デフォルトモデルは 'simba-english' です - 'simba-3.2' は、最小のレイテンシーと最も豊かな表現力を備えた Speechify の最新ストリーミングモデルで、英語向けの推奨モデルです - 現在、'simba-3.2' と 'simba-3.0' は英語だけに対応しています。英語以外または複数言語が混在する入力には 'simba-multilingual' を使用してください - 'simba-3.2' と 'simba-3.0' で利用できるのは、厳選された Voice セット('beatrice\_32'、'dominic\_32'、'edmund\_32'、'geffen\_32'、'harper\_32'、'hugh\_32'、'imogen\_32'、'wyatt\_32')だけです。'george' など従来のカタログ Voice をこれらのモデルで使用するとエラーになります - デフォルトの Speaker は設定されたモデルに従い、Simba 3 モデルでは 'harper\_32'、それ以外では 'george' です - Speech-to-Text 機能はサポートされていません - speak() メソッドの options パラメーターで、追加の音声ストリームオプションを渡せます