> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 플레이AI Mastra의 PlayAI 음성 구현은 PlayAI의 API를 사용하여 텍스트 음성 변환 기능을 제공합니다. ## 사용예 ```typescript import { PlayAIVoice } from '@mastra/voice-playai' // Initialize with default configuration (uses PLAYAI_API_KEY environment variable and PLAYAI_USER_ID environment variable) const voice = new PlayAIVoice() // Initialize with default configuration const voice = new PlayAIVoice({ speechModel: { name: 'PlayDialog', apiKey: process.env.PLAYAI_API_KEY, userId: process.env.PLAYAI_USER_ID, }, speaker: 'Angelo', // Default voice }) // Convert text to speech with a specific voice const audioStream = await voice.speak('Hello, world!', { speaker: 's3://voice-cloning-zero-shot/b27bc13e-996f-4841-b584-4d35801aea98/original/manifest.json', // Dexter voice }) ``` ## 생성자 매개변수 **speechModel** (`PlayAIConfig`): 텍스트-음성 기능의 구성 (Default: `{ name: 'PlayDialog' }`) **speechModel.name** (`'PlayDialog' | 'Play3.0-mini'`): 사용할 PlayAI Model **speechModel.apiKey** (`string`): PlayAI API 키입니다. 지정하지 않으면 PLAYAI\_API\_KEY 환경 변수를 사용합니다 **speechModel.userId** (`string`): PlayAI 사용자 ID입니다. 지정하지 않으면 PLAYAI\_USER\_ID 환경 변수를 사용합니다 **speaker** (`string`): 음성 합성에 사용할 기본 음성 ID (Default: `사용 가능한 첫 번째 음성 ID`) ## 행동 양식 ### `speak()` 구성된 음성 Model 및 음성을 사용하여 텍스트를 음성으로 변환합니다. **input** (`string | NodeJS.ReadableStream`): 음성으로 변환할 텍스트입니다. 스트림을 제공하면 먼저 텍스트로 변환됩니다. **options** (`Options`): 구성 옵션입니다. **options.speaker** (`string`): 이 요청의 기본 화자를 재정의합니다 보고:`Promise`. ### `getSpeakers()` 각 노드에 다음이 포함된 사용 가능한 음성 옵션의 배열을 반환합니다. **name** (`string`): 음성의 이름 **accent** (`string`): 음성의 억양(예: 'US', 'British', 'Australian') **gender** (`'M' | 'F'`): 음성의 성별 **age** (`'Young' | 'Middle' | 'Old'`): 음성의 연령 범주 **style** (`'Conversational' | 'Narrative'`): 음성의 말하기 스타일 **voiceId** (`string`): 음성의 고유 식별자 ### `listen()` 이 방법은 PlayAI에서 지원되지 않으며 오류가 발생합니다. PlayAI는 음성-텍스트 기능을 제공하지 않습니다. ## 메모 - PlayAI는 인증을 위해 API 키와 사용자 ID가 모두 필요합니다. - 이 서비스는 'PlayDialog'와 'Play3.0-mini'의 두 가지 Model을 제공합니다. - 각 음성에는 API 호출 시 사용해야 하는 고유한 S3 매니페스트 ID가 있습니다.