Skip to content

Commit d29d3ae

Browse files
authored
Add CereVoice Cloud v2 TTS engine (#56)
1 parent 363afc9 commit d29d3ae

13 files changed

Lines changed: 1175 additions & 0 deletions

File tree

docs/CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ ELEVENLABS_API_KEY=your-elevenlabs-api-key
6060
GOOGLE_APPLICATION_CREDENTIALS=path/to/google-credentials.json
6161
# or
6262
GOOGLE_SA_PATH=path/to/google-credentials.json
63+
64+
# CereVoice TTS
65+
CEREVOICE_EMAIL=your-cerevoice-email
66+
CEREVOICE_PASSWORD=your-cerevoice-password
6367
```
6468

6569
## Code Style

docs/RELEASING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ The following secrets need to be configured in the GitHub repository for the aut
7474
- `MICROSOFT_REGION`: Azure TTS region (optional, for testing)
7575
- `ELEVENLABS_API_KEY`: ElevenLabs API key (optional, for testing)
7676
- `GOOGLE_SA_KEY`: Google Cloud service account key in JSON format (optional, for testing)
77+
- `CEREVOICE_EMAIL`: CereVoice Cloud account email (optional, for live testing)
78+
- `CEREVOICE_PASSWORD`: CereVoice Cloud account password (optional, for live testing)
7779

7880
## Versioning
7981

docs/TESTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ GOOGLE_APPLICATION_CREDENTIALS=path_to_your_google_credentials_json
2424
GOOGLE_SA_PATH=path_to_your_google_service_account_json
2525
```
2626

27+
### CereVoice TTS
28+
```
29+
CEREVOICE_EMAIL=your_cerevoice_email
30+
CEREVOICE_PASSWORD=your_cerevoice_password
31+
# Optional
32+
CEREVOICE_ACCESS_TOKEN=existing_access_token
33+
CEREVOICE_REFRESH_TOKEN=existing_refresh_token
34+
```
35+
2736
You can set these environment variables in a `.env` file in the root of the project.
2837

2938
## Running Tests
@@ -57,10 +66,15 @@ npm run test:elevenlabs
5766

5867
# Test Google TTS
5968
npm run test:google
69+
70+
# Test CereVoice unit coverage
71+
npm run test:cerevoice
6072
```
6173

6274
If your credentials for the specified engine are invalid, the tests will be skipped with a clear message.
6375

76+
`npm run test:cerevoice` runs mocked unit coverage for auth, voice mapping, synthesis request shape, metadata fetching, and word-boundary conversion. It does not require live CereVoice credentials.
77+
6478
## Running Examples
6579

6680
The project includes a unified example framework that can demonstrate all TTS engines or specific engines.

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ The following engines work in browser environments:
108108
- **Azure TTS** - Requires subscription key + region
109109
- **Google Cloud TTS** - Requires service account JSON
110110
- **AWS Polly** - Requires access key + secret + region
111+
- **CereVoice Cloud** - Requires email + password, supports SSML and word-boundary metadata
111112
- **Wit.ai TTS** - Requires API token
112113
- **Watson TTS** - Requires API key + URL
113114

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"test:env": "node load-env.js && jest",
5959
"test:tts": "node run-tts-tests.cjs",
6060
"test:azure": "node run-tts-tests.cjs azure",
61+
"test:cerevoice": "cross-env NODE_OPTIONS=--experimental-vm-modules jest src/__tests__/cerevoice.test.ts",
6162
"test:elevenlabs": "node run-tts-tests.cjs elevenlabs",
6263
"test:google": "node run-tts-tests.cjs google",
6364
"test:gemini": "node run-tts-tests.cjs gemini",
@@ -119,6 +120,8 @@
119120
"tts",
120121
"text-to-speech",
121122
"azure",
123+
"cerevoice",
124+
"cereproc",
122125
"google",
123126
"gemini",
124127
"polly",
@@ -251,6 +254,7 @@
251254
"@google-cloud/text-to-speech": "^6.4.0"
252255
},
253256
"gemini": {},
257+
"cerevoice": {},
254258
"elevenlabs": {
255259
"@elevenlabs/elevenlabs-js": "^2.32.0"
256260
},

0 commit comments

Comments
 (0)