@mastra/voice-murf 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/LICENSE.md +15 -0
- package/dist/docs/SKILL.md +15 -21
- package/dist/docs/{SOURCE_MAP.json → assets/SOURCE_MAP.json} +1 -1
- package/dist/docs/references/docs-agents-adding-voice.md +350 -0
- package/dist/docs/references/docs-voice-overview.md +1188 -0
- package/dist/docs/references/reference-voice-murf.md +118 -0
- package/dist/index.cjs +44 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -17
- package/dist/index.js.map +1 -1
- package/package.json +11 -15
- package/dist/docs/README.md +0 -32
- package/dist/docs/agents/01-adding-voice.md +0 -352
- package/dist/docs/voice/01-overview.md +0 -1019
- package/dist/docs/voice/02-reference.md +0 -83
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# Voice API Reference
|
|
2
|
-
|
|
3
|
-
> API reference for voice - 1 entries
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Reference: Murf
|
|
9
|
-
|
|
10
|
-
> Documentation for the Murf voice implementation, providing text-to-speech capabilities.
|
|
11
|
-
|
|
12
|
-
The Murf voice implementation in Mastra provides text-to-speech (TTS) capabilities using Murf's AI voice service. It supports multiple voices across different languages.
|
|
13
|
-
|
|
14
|
-
## Usage Example
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
import { MurfVoice } from "@mastra/voice-murf";
|
|
18
|
-
|
|
19
|
-
// Initialize with default configuration (uses MURF_API_KEY environment variable)
|
|
20
|
-
const voice = new MurfVoice();
|
|
21
|
-
|
|
22
|
-
// Initialize with custom configuration
|
|
23
|
-
const voice = new MurfVoice({
|
|
24
|
-
speechModel: {
|
|
25
|
-
name: "GEN2",
|
|
26
|
-
apiKey: "your-api-key",
|
|
27
|
-
properties: {
|
|
28
|
-
format: "MP3",
|
|
29
|
-
rate: 1.0,
|
|
30
|
-
pitch: 1.0,
|
|
31
|
-
sampleRate: 48000,
|
|
32
|
-
channelType: "STEREO",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
speaker: "en-US-cooper",
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// Text-to-Speech with default settings
|
|
39
|
-
const audioStream = await voice.speak("Hello, world!");
|
|
40
|
-
|
|
41
|
-
// Text-to-Speech with custom properties
|
|
42
|
-
const audioStream = await voice.speak("Hello, world!", {
|
|
43
|
-
speaker: "en-UK-hazel",
|
|
44
|
-
properties: {
|
|
45
|
-
format: "WAV",
|
|
46
|
-
rate: 1.2,
|
|
47
|
-
style: "casual",
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Get available voices
|
|
52
|
-
const voices = await voice.getSpeakers();
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Constructor Parameters
|
|
56
|
-
|
|
57
|
-
### MurfConfig
|
|
58
|
-
|
|
59
|
-
### Speech Properties
|
|
60
|
-
|
|
61
|
-
## Methods
|
|
62
|
-
|
|
63
|
-
### speak()
|
|
64
|
-
|
|
65
|
-
Converts text to speech using Murf's API.
|
|
66
|
-
|
|
67
|
-
Returns: `Promise<NodeJS.ReadableStream>`
|
|
68
|
-
|
|
69
|
-
### getSpeakers()
|
|
70
|
-
|
|
71
|
-
Returns an array of available voice options, where each node contains:
|
|
72
|
-
|
|
73
|
-
### listen()
|
|
74
|
-
|
|
75
|
-
This method is not supported by Murf and will throw an error. Murf does not provide speech-to-text functionality.
|
|
76
|
-
|
|
77
|
-
## Important Notes
|
|
78
|
-
|
|
79
|
-
1. A Murf API key is required. Set it via the `MURF_API_KEY` environment variable or pass it in the constructor.
|
|
80
|
-
2. The service uses GEN2 as the default model version.
|
|
81
|
-
3. Speech properties can be set at the constructor level and overridden per request.
|
|
82
|
-
4. The service supports extensive audio customization through properties like format, sample rate, and channel type.
|
|
83
|
-
5. Speech-to-text functionality is not supported.
|