mia-narrative 1.0.6 → 1.0.8

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/README.md CHANGED
@@ -1,112 +1,123 @@
1
1
  # 🎙️ mia-narrative CLI
2
2
 
3
- A powerful, multi-engine text-to-speech command-line tool for narrative audio generation.
3
+ **Transform your text into expressive audio narratives.** Choose between professional narrators, adjust their tone and pace, add ambient effects—all from your command line. No recording equipment needed.
4
4
 
5
- ## Features
5
+ ## What You Can Do
6
6
 
7
- - **Multiple TTS Engines**:
8
- - `system`: Uses the operating system's built-in TTS. No setup required.
9
- - `elevenlabs`: High-quality, low-latency speech from ElevenLabs. Requires an API key.
10
- - `piper`: High-quality, local, and private TTS via Piper. Requires Piper to be installed.
11
- - **Audio Effects**: Customize your audio with effects like speed, pitch, volume, and more.
12
- - **Simple Interface**: Easy-to-use commands for generating audio and listing voices.
7
+ 🎭 **Meet the Voices**
8
+ - **Mia**: Professional, technical content expert
9
+ - **Miette**: Conversational, warm British charm
10
+ - **Seraphine & Echo**: Expressive storytellers
11
+ - **Jeremy & Atlas**: Confident male narrators
12
+ - **ResoNova & Zephyr**: Unique, experimental voices
13
+
14
+ 💨 **Shape Your Audio**
15
+ - Adjust speech speed (0.5x - 2.0x)
16
+ - Change pitch and tone
17
+ - Add reverb, echo, or compression effects
18
+ - Insert natural pauses at sentence boundaries
19
+
20
+ 🔌 **Multiple Engines**
21
+ - **System**: Your OS's built-in voice (quick, no setup)
22
+ - **Piper**: Private, local, open-source (best control)
23
+ - **ElevenLabs**: Cloud-based, premium quality (requires API key)
13
24
 
14
25
  ## Installation
15
26
 
16
27
  ### Prerequisites
28
+ - **Node.js** v18+
29
+ - **FFmpeg** (for audio processing)
30
+ - **Piper** (optional, for better voices)
17
31
 
18
- 1. **Node.js**: v18 or higher.
19
- 2. **FFmpeg**: For audio processing.
20
- 3. **(Optional) Piper TTS**: If you plan to use the `piper` engine. Install from [https://github.com/rhasspy/piper](https://github.com/rhasspy/piper).
21
-
22
- ### Setup
32
+ ### Get Started
23
33
 
24
34
  ```bash
25
- cd /workspace/MiaNar/cli
35
+ git clone <repo>
36
+ cd cli
26
37
  npm install
27
38
  npm run build
28
- npm link # Makes 'mia-narrative' globally available
39
+ npm link # Makes 'mia-narrative' available globally
29
40
  ```
30
41
 
31
- ## Configuration
32
-
33
- ### System Engine
34
-
35
- No configuration is required. This is the default engine.
36
-
37
- ### ElevenLabs Engine
38
-
39
- Set your ElevenLabs API key as an environment variable:
42
+ ### Optional: Setup Professional Voices
40
43
 
41
44
  ```bash
42
- export ELEVENLABS_API_KEY="your_api_key_here"
45
+ npm run setup
46
+ # Automatically downloads Piper models (one-time, ~380MB)
43
47
  ```
44
48
 
45
- ### Piper Engine
49
+ ### Optional: ElevenLabs (Cloud Voices)
46
50
 
47
- Set the path to your Piper model(s) directory:
51
+ Get an API key from [elevenlabs.io](https://elevenlabs.io):
48
52
 
49
53
  ```bash
50
- export MIA_NARRATIVE_PIPER_MODEL_PATH="/path/to/your/piper/models"
54
+ export ELEVENLABS_API_KEY="your_key_here"
55
+ mia-narrative g -E elevenlabs -T "Hello" -O output.mp3
51
56
  ```
52
- You also need to specify the piper executable path if it's not in your PATH:
53
- ```bash
54
- export MIA_NARRATIVE_PIPER_PATH="/path/to/your/piper/executable"
55
- ```
56
-
57
- ## Usage
58
-
59
- ### Generate Audio
60
57
 
61
- **Using the default `system` engine:**
58
+ ## Quick Start
62
59
 
60
+ **Simplest command** (uses system voice):
63
61
  ```bash
64
- mia-narrative generate --text "Hello from my computer" --output hello.mp3
62
+ mia-narrative g -T "Hello, world!"
65
63
  ```
66
64
 
67
- **Using the `elevenlabs` engine:**
68
-
65
+ **With a specific voice** (Miette with British accent):
69
66
  ```bash
70
- mia-narrative generate --engine elevenlabs --text "Hello from the cloud" --voiceId "Rachel" --output cloud.mp3
67
+ mia-narrative g -E piper -v miette -T "What a lovely day!" -O story.mp3
71
68
  ```
72
69
 
73
- **Using the `piper` engine with a file:**
74
-
70
+ **From a text file** with effects:
75
71
  ```bash
76
- mia-narrative generate --engine piper --file story.txt --voiceId "en_US-lessac-medium" --output story.mp3
72
+ mia-narrative g -E piper -v mia -F chapter.txt --pitch 1.1 --speed 0.95 -O chapter.mp3
77
73
  ```
78
74
 
79
- **With audio parameters:**
80
-
75
+ **Professional narrator** with full effects:
81
76
  ```bash
82
- mia-narrative generate \
83
- --file chapter.txt \
84
- --engine piper \
85
- --voiceId "en_US-lessac-medium" \
77
+ mia-narrative g \
78
+ -E piper \
79
+ -v mia \
80
+ -F narrative.txt \
81
+ --pitch 1.0 \
86
82
  --speed 0.9 \
87
- --pitch 1.1 \
88
- --output chapter.mp3
83
+ --reverb 0.3 \
84
+ --compression 0.4 \
85
+ -O final.mp3
89
86
  ```
90
87
 
91
- ### List Voices
88
+ ### Command & Option Reference
92
89
 
93
- List voices for a specific engine.
90
+ - `g` = short for `generate` command
91
+ - `-E, --engine` = which TTS engine (piper, elevenlabs, system)
92
+ - `-v, --voiceId` = which narrator (mia, miette, seraphine, jeremy, etc.)
93
+ - `-T, --text` = text to speak
94
+ - `-F, --file` = read from file instead
95
+ - `-O, --output` = where to save (default: output.mp3)
94
96
 
95
- **List system voices:**
97
+ ### Explore Voices
98
+
99
+ See which narrators are available:
96
100
 
97
101
  ```bash
102
+ # See system voices (quick, no setup)
98
103
  mia-narrative voices --engine system
99
- ```
100
104
 
101
- **List ElevenLabs voices (in JSON format):**
105
+ # See Piper personalities (download models first)
106
+ mia-narrative voices --engine piper
102
107
 
103
- ```bash
104
- mia-narrative voices --engine elevenlabs --format json
108
+ # See ElevenLabs options (requires API key)
109
+ mia-narrative voices --engine elevenlabs
105
110
  ```
106
111
 
107
- **List Piper voices:**
112
+ Output shows voice ID, personality, and which model it uses.
113
+
114
+ ### Setup Piper (Optional)
115
+
116
+ Get access to professional voices with full control:
117
+
108
118
  ```bash
109
- mia-narrative voices --engine piper
119
+ npm run setup
120
+ # Downloads Mia, Miette, Seraphine, Jeremy, ResoNova, Zephyr, Echo, Atlas
110
121
  ```
111
122
 
112
123
  ## Audio Parameters
@@ -125,25 +136,25 @@ mia-narrative voices --engine piper
125
136
 
126
137
  ## Environment Variables
127
138
 
128
- - `ELEVENLABS_API_KEY`: Your API key for the ElevenLabs engine.
129
- - `MIA_NARRATIVE_PIPER_PATH`: Custom path to the Piper binary (e.g., `/usr/local/bin/piper`).
130
- - `MIA_NARRATIVE_PIPER_MODEL_PATH`: Path to the directory containing Piper voice models.
131
- - `DEBUG`: Set to `1` for verbose debug output.
139
+ | Variable | What it does |
140
+ |----------|-------------|
141
+ | `ELEVENLABS_API_KEY` | Your API key for cloud voices |
142
+ | `MIA_NARRATIVE_PIPER_PATH` | Custom path to Piper binary (if not in PATH) |
143
+ | `DEBUG` | Set to `1` for verbose output |
132
144
 
133
145
  ## Troubleshooting
134
146
 
135
- ### FFmpeg not found
136
-
137
- Install FFmpeg using your system's package manager (e.g., `brew install ffmpeg`, `sudo apt-get install ffmpeg`).
138
-
139
- ## Development
147
+ | Issue | Fix |
148
+ |-------|-----|
149
+ | FFmpeg not found | `brew install ffmpeg` (Mac) or `apt-get install ffmpeg` (Linux) |
150
+ | Piper not found | Install from [github.com/rhasspy/piper](https://github.com/rhasspy/piper) |
151
+ | Voices not available | Run `npm run setup` to download Piper models |
152
+ | API errors with ElevenLabs | Check your `ELEVENLABS_API_KEY` is set correctly |
140
153
 
141
- Build the project:
142
- ```bash
143
- npm run build
144
- ```
154
+ ## Contributing & Development
145
155
 
146
- Run in development mode:
147
156
  ```bash
148
- npm run dev -- voices --engine system
157
+ npm run build # Compile TypeScript
158
+ npm run dev -- g -T "test" # Run in dev mode
159
+ npm test # Run tests
149
160
  ```
@@ -13,17 +13,18 @@ program
13
13
 
14
14
  program
15
15
  .command('generate')
16
+ .alias('g')
16
17
  .description('Generate audio from text')
17
- .option('--text <text>', 'Text to convert to speech')
18
- .option('--file <path>', 'Read text from file')
18
+ .option('-T, --text <text>', 'Text to convert to speech')
19
+ .option('-F, --file <path>', 'Read text from file')
19
20
  .option(
20
- '--engine <name>',
21
+ '-E, --engine <name>',
21
22
  'TTS engine to use (system, elevenlabs, piper)',
22
23
  'system'
23
24
  )
24
- .option('--voiceId <id>', 'Voice ID to use')
25
+ .option('-v, --voiceId <id>', 'Voice ID to use')
25
26
  .option(
26
- '--output <path>',
27
+ '-O, --output <path>',
27
28
  'Output MP3 file path (default: output.mp3)'
28
29
  )
29
30
  .option(
@@ -9,12 +9,13 @@ program
9
9
  .version('1.0.0');
10
10
  program
11
11
  .command('generate')
12
+ .alias('g')
12
13
  .description('Generate audio from text')
13
- .option('--text <text>', 'Text to convert to speech')
14
- .option('--file <path>', 'Read text from file')
15
- .option('--engine <name>', 'TTS engine to use (system, elevenlabs, piper)', 'system')
16
- .option('--voiceId <id>', 'Voice ID to use')
17
- .option('--output <path>', 'Output MP3 file path (default: output.mp3)')
14
+ .option('-T, --text <text>', 'Text to convert to speech')
15
+ .option('-F, --file <path>', 'Read text from file')
16
+ .option('-E, --engine <name>', 'TTS engine to use (system, elevenlabs, piper)', 'system')
17
+ .option('-v, --voiceId <id>', 'Voice ID to use')
18
+ .option('-O, --output <path>', 'Output MP3 file path (default: output.mp3)')
18
19
  .option('--speed <number>', 'Speech rate (default: 1.0)', parseFloat)
19
20
  .option('--pitch <number>', 'Pitch (default: 1.0)', parseFloat)
20
21
  .option('--volume <number>', 'Volume (default: 0.8)', parseFloat)
@@ -1 +1 @@
1
- {"version":3,"file":"mia-narrative.js","sourceRoot":"","sources":["../../bin/mia-narrative.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,eAAe,CAAC;KACrB,WAAW,CAAC,mDAAmD,CAAC;KAChE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,eAAe,EAAE,2BAA2B,CAAC;KACpD,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC;KAC9C,MAAM,CACL,iBAAiB,EACjB,+CAA+C,EAC/C,QAAQ,CACT;KACA,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KAC3C,MAAM,CACL,iBAAiB,EACjB,4CAA4C,CAC7C;KACA,MAAM,CACL,kBAAkB,EAClB,4BAA4B,EAC5B,UAAU,CACX;KACA,MAAM,CACL,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,CACX;KACA,MAAM,CACL,mBAAmB,EACnB,uBAAuB,EACvB,UAAU,CACX;KACA,MAAM,CACL,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,CACX;KACA,MAAM,CACL,mBAAmB,EACnB,uBAAuB,EACvB,UAAU,CACX;KACA,MAAM,CACL,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,CACX;KACA,MAAM,CACL,wBAAwB,EACxB,4BAA4B,EAC5B,UAAU,CACX;KACA,MAAM,CACL,kBAAkB,EAClB,6BAA6B,EAC7B,UAAU,CACX;KACA,MAAM,CAAC,eAAe,CAAC,CAAC;AAE3B,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CACL,iBAAiB,EACjB,2DAA2D,EAC3D,QAAQ,CACT;KACA,MAAM,CACL,mBAAmB,EACnB,mCAAmC,EACnC,OAAO,CACR;KACA,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"mia-narrative.js","sourceRoot":"","sources":["../../bin/mia-narrative.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EA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2D,EAC3D,QAAQ,CACT;KACA,MAAM,CACL,mBAAmB,EACnB,mCAAmC,EACnC,OAAO,CACR;KACA,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO,CAAC,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mia-narrative",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Text-to-speech CLI for narrative audio generation",
5
5
  "type": "module",
6
6
  "bin": {