> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 머프 Mastra의 Murf 음성 구현은 Murf의 AI 음성 서비스를 사용하여 텍스트 음성 변환(TTS) 기능을 제공합니다. 다양한 언어에 걸쳐 다양한 음성을 지원합니다. ## 사용예 ```typescript import { MurfVoice } from '@mastra/voice-murf' // Initialize with default configuration (uses MURF_API_KEY environment variable) const voice = new MurfVoice() // Initialize with custom configuration const voice = new MurfVoice({ speechModel: { name: 'GEN2', apiKey: 'your-api-key', properties: { format: 'MP3', rate: 1.0, pitch: 1.0, sampleRate: 48000, channelType: 'STEREO', }, }, speaker: 'en-US-cooper', }) // Text-to-Speech with default settings const audioStream = await voice.speak('Hello, world!') // Text-to-Speech with custom properties const audioStream = await voice.speak('Hello, world!', { speaker: 'en-UK-hazel', properties: { format: 'WAV', rate: 1.2, style: 'casual', }, }) // Get available voices const voices = await voice.getSpeakers() ``` ## 생성자 매개변수 **speechModel** (`MurfConfig`): 텍스트-음성 기능의 구성 (Default: `{ name: 'GEN2' }`) **speechModel.name** (`'GEN1' | 'GEN2'`): 사용할 Murf Model 세대 **speechModel.apiKey** (`string`): Murf API 키입니다. 지정하지 않으면 MURF\_API\_KEY 환경 변수를 사용합니다 **speechModel.properties** (`object`): 모든 음성 합성 요청에 적용할 기본 속성 **speechModel.properties.style** (`string`): 음성의 말하기 스타일 **speechModel.properties.rate** (`number`): 말하기 속도 배율 **speechModel.properties.pitch** (`number`): 음성 피치 조정값 **speechModel.properties.sampleRate** (`8000 | 24000 | 44100 | 48000`): Hz 단위의 오디오 샘플링 속도 **speechModel.properties.format** (`'MP3' | 'WAV' | 'FLAC' | 'ALAW' | 'ULAW'`): 출력 오디오 형식 **speechModel.properties.channelType** (`'STEREO' | 'MONO'`): 오디오 채널 구성 **speechModel.properties.pronunciationDictionary** (`Record`): 사용자 정의 발음 매핑 **speechModel.properties.encodeAsBase64** (`boolean`): 오디오를 Base64로 인코딩할지 여부 **speechModel.properties.variation** (`number`): 음성 변형 매개변수 **speechModel.properties.audioDuration** (`number`): 초 단위의 목표 오디오 길이 **speechModel.properties.multiNativeLocale** (`string`): 다국어 지원에 사용할 로캘 **speaker** (`string`): 텍스트-음성 변환에 사용할 기본 음성 ID (Default: `'en-UK-hazel'`) ## 행동 양식 ### `speak()` Murf의 API를 사용하여 텍스트를 음성으로 변환합니다. **input** (`string | NodeJS.ReadableStream`): 음성으로 변환할 텍스트입니다. 스트림을 제공하면 먼저 텍스트로 변환됩니다. **options** (`object`): 음성 합성 옵션 **options.speaker** (`string`): 이 요청의 기본 화자를 재정의합니다 **options.properties** (`object`): 이 요청의 기본 음성 속성을 재정의합니다 보고:`Promise` ### `getSpeakers()` 각 노드에 다음이 포함된 사용 가능한 음성 옵션의 배열을 반환합니다. **voiceId** (`string`): 음성의 고유 식별자 **name** (`string`): 음성의 표시 이름 **language** (`string`): 음성의 언어 코드 **gender** (`string`): 음성의 성별 ### `listen()` 이 방법은 Murf에서 지원되지 않으며 오류가 발생합니다. Murf는 음성-텍스트 기능을 제공하지 않습니다. ## 중요 사항 1. Murf API 키가 필요합니다. `MURF_API_KEY` 환경 변수를 통해 설정하거나 생성자에 전달하세요. 2. 이 서비스는 GEN2를 기본 Model 버전으로 사용합니다. 3. 음성 속성은 생성자 수준에서 설정하고 요청별로 재정의할 수 있습니다. 4. 이 서비스는 형식, 샘플링 속도, 채널 유형과 같은 속성을 통해 광범위한 오디오 사용자 정의를 지원합니다. 5. 음성-텍스트 기능은 지원되지 않습니다.