@charivo/tts 0.9.1 → 0.10.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/README.md +8 -1
- package/dist/gemini/index.d.mts +4 -3
- package/dist/gemini/index.d.ts +4 -3
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -32,6 +32,8 @@ Speech API) must use `"web-speech"` mode instead.
|
|
|
32
32
|
pnpm add @charivo/tts
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
Requires Node.js 22 or newer, as declared in this package's `engines`.
|
|
36
|
+
|
|
35
37
|
## Usage
|
|
36
38
|
|
|
37
39
|
```ts
|
|
@@ -63,7 +65,12 @@ await ttsManager.speak("Hello", { voice: "marin" });
|
|
|
63
65
|
`OpenAITTSProvider`, `type OpenAITTSConfig`
|
|
64
66
|
- `@charivo/tts/gemini`: `createGeminiTTSPlayer(config)` (browser player,
|
|
65
67
|
dev/testing only) and, for server-side use, `createGeminiTTSProvider(config)`,
|
|
66
|
-
`GeminiTTSProvider`, `type GeminiTTSConfig`. The
|
|
68
|
+
`GeminiTTSProvider`, `type GeminiTTSConfig`. The player's `config.streaming`
|
|
69
|
+
is opt-in and off by default: this player caps no text, so a long one is
|
|
70
|
+
truncated by the streaming endpoint with a non-`STOP` finish reason and fails
|
|
71
|
+
mid-sentence where the buffered path completes it, and streamed playback
|
|
72
|
+
needs a running `AudioContext`, so `speak()` starts requiring a
|
|
73
|
+
`prepareAudio()` call from a user gesture. The provider wraps Gemini's raw
|
|
67
74
|
PCM (`audio/l16`) response as a 16-bit WAV file; `rate` and `pitch` are
|
|
68
75
|
ignored, since the API has no speed or pitch control; voices are Google's
|
|
69
76
|
prebuilt names (default `Kore`). The text is sent behind a fixed synthesis
|
package/dist/gemini/index.d.mts
CHANGED
|
@@ -21,9 +21,10 @@ interface GeminiTTSConfig {
|
|
|
21
21
|
* A 5xx or an answer carrying no audio is retried once inside the same
|
|
22
22
|
* `timeoutMs`, not a fresh one.
|
|
23
23
|
*
|
|
24
|
-
* `generateSpeech` does not stream: measured latency is
|
|
25
|
-
* plus
|
|
26
|
-
* 68s), so a short reply does not get proportionally
|
|
24
|
+
* `generateSpeech` does not stream: measured latency is roughly one second of
|
|
25
|
+
* fixed startup cost plus about 0.7x the audio duration (56 chars ~ 3s, 120 ~
|
|
26
|
+
* 6s, 600 ~ 20s, 1,800 ~ 68s), so a short reply does not get proportionally
|
|
27
|
+
* cheaper. The long end is
|
|
27
28
|
* why the default budget is 90s. That default suits the direct player and
|
|
28
29
|
* callers that own their own deadline; a route behind `@charivo/tts/remote`
|
|
29
30
|
* must pass a `timeoutMs` under that player's fixed 30s (e.g. 25_000) so the
|
package/dist/gemini/index.d.ts
CHANGED
|
@@ -21,9 +21,10 @@ interface GeminiTTSConfig {
|
|
|
21
21
|
* A 5xx or an answer carrying no audio is retried once inside the same
|
|
22
22
|
* `timeoutMs`, not a fresh one.
|
|
23
23
|
*
|
|
24
|
-
* `generateSpeech` does not stream: measured latency is
|
|
25
|
-
* plus
|
|
26
|
-
* 68s), so a short reply does not get proportionally
|
|
24
|
+
* `generateSpeech` does not stream: measured latency is roughly one second of
|
|
25
|
+
* fixed startup cost plus about 0.7x the audio duration (56 chars ~ 3s, 120 ~
|
|
26
|
+
* 6s, 600 ~ 20s, 1,800 ~ 68s), so a short reply does not get proportionally
|
|
27
|
+
* cheaper. The long end is
|
|
27
28
|
* why the default budget is 90s. That default suits the direct player and
|
|
28
29
|
* callers that own their own deadline; a route behind `@charivo/tts/remote`
|
|
29
30
|
* must pass a `timeoutMs` under that player's fixed 30s (e.g. 25_000) so the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charivo/tts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "TTS manager and browser adapters for Charivo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -41,13 +41,16 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@charivo/core": "^0.36.0",
|
|
44
|
-
"openai": "^
|
|
44
|
+
"openai": "^7.10.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.5.0",
|
|
48
48
|
"typescript": "^5.9.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22.0.0"
|
|
53
|
+
},
|
|
51
54
|
"files": [
|
|
52
55
|
"dist",
|
|
53
56
|
"!dist/metafile-*.json"
|