echogarden 0.9.3 → 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 +3 -7
- package/data/schemas/options.json +57 -26
- package/dist/api/API.d.ts +2 -0
- package/dist/api/API.js +2 -0
- package/dist/api/API.js.map +1 -1
- package/dist/api/Alignment.d.ts +4 -4
- package/dist/api/Alignment.js +31 -31
- package/dist/api/Alignment.js.map +1 -1
- package/dist/api/Denoising.d.ts +9 -3
- package/dist/api/Denoising.js +9 -9
- package/dist/api/Denoising.js.map +1 -1
- package/dist/api/LanguageDetection.d.ts +13 -17
- package/dist/api/LanguageDetection.js +13 -17
- package/dist/api/LanguageDetection.js.map +1 -1
- package/dist/api/Recognition.d.ts +4 -4
- package/dist/api/Recognition.js +10 -12
- package/dist/api/Recognition.js.map +1 -1
- package/dist/api/Synthesis.d.ts +10 -6
- package/dist/api/Synthesis.js +61 -25
- package/dist/api/Synthesis.js.map +1 -1
- package/dist/api/Translation.d.ts +4 -4
- package/dist/api/Translation.js +11 -12
- package/dist/api/Translation.js.map +1 -1
- package/dist/api/Vad.d.ts +5 -8
- package/dist/api/Vad.js +12 -14
- package/dist/api/Vad.js.map +1 -1
- package/dist/audio/AudioPlayer.d.ts +1 -1
- package/dist/audio/AudioPlayer.js +12 -14
- package/dist/audio/AudioPlayer.js.map +1 -1
- package/dist/audio/AudioUtilities.d.ts +2 -0
- package/dist/audio/AudioUtilities.js +28 -0
- package/dist/audio/AudioUtilities.js.map +1 -1
- package/dist/audio/SoxPath.js +4 -0
- package/dist/audio/SoxPath.js.map +1 -1
- package/dist/cli/CLI.js +88 -124
- package/dist/cli/CLI.js.map +1 -1
- package/dist/codecs/FFMpegTranscoder.d.ts +1 -0
- package/dist/codecs/FFMpegTranscoder.js +48 -2
- package/dist/codecs/FFMpegTranscoder.js.map +1 -1
- package/dist/denoising/RNNoise.js.map +1 -1
- package/dist/dsp/MFCC.js.map +1 -1
- package/dist/recognition/WhisperSTT.js +2 -2
- package/dist/recognition/WhisperSTT.js.map +1 -1
- package/dist/server/Client.d.ts +10 -8
- package/dist/server/Client.js +56 -59
- package/dist/server/Client.js.map +1 -1
- package/dist/server/Server.d.ts +1 -1
- package/dist/server/Server.js +24 -13
- package/dist/server/Server.js.map +1 -1
- package/dist/server/ServerStarter.js +2 -2
- package/dist/server/ServerStarter.js.map +1 -1
- package/dist/server/Worker.d.ts +28 -11
- package/dist/server/Worker.js +45 -12
- package/dist/server/Worker.js.map +1 -1
- package/dist/speech-language-detection/SileroLanguageDetection.js +2 -2
- package/dist/speech-language-detection/SileroLanguageDetection.js.map +1 -1
- package/dist/synthesis/GoogleTranslateTTS.js.map +1 -1
- package/dist/synthesis/MicrosoftEdgeTTS.js +1 -1
- package/dist/synthesis/MicrosoftEdgeTTS.js.map +1 -1
- package/dist/synthesis/VitsTTS.js.map +1 -1
- package/dist/utilities/Logger.d.ts +2 -2
- package/dist/utilities/Logger.js +7 -9
- package/dist/utilities/Logger.js.map +1 -1
- package/dist/utilities/ObjectUtilities.js +4 -1
- package/dist/utilities/ObjectUtilities.js.map +1 -1
- package/dist/utilities/PackageManager.js +3 -1
- package/dist/utilities/PackageManager.js.map +1 -1
- package/dist/utilities/Timeline.js.map +1 -1
- package/docs/API.md +215 -0
- package/docs/Options.md +30 -23
- package/docs/Server.md +158 -0
- package/docs/Tasklist.md +4 -8
- package/package.json +7 -7
|
@@ -4,10 +4,10 @@ export declare class Logger {
|
|
|
4
4
|
start(title: string, titleColor?: import("chalk").ChalkInstance): void;
|
|
5
5
|
startAsync(title: string, yieldBeforeStart?: boolean, titleColor?: import("chalk").ChalkInstance): Promise<void>;
|
|
6
6
|
end(): void;
|
|
7
|
-
|
|
7
|
+
logDuration(message: any, startTime: number, titleColor?: import("chalk").ChalkInstance): void;
|
|
8
8
|
logTitledMessage(title: string, content: string, titleColor?: import("chalk").ChalkInstance): void;
|
|
9
|
+
log(message: any): void;
|
|
9
10
|
write(message: any): void;
|
|
10
|
-
logDuration(message: any, startTime: number, titleColor?: import("chalk").ChalkInstance): void;
|
|
11
11
|
getTimestamp(): number;
|
|
12
12
|
}
|
|
13
13
|
export declare function resetActiveLogger(): void;
|
package/dist/utilities/Logger.js
CHANGED
|
@@ -29,14 +29,16 @@ export class Logger {
|
|
|
29
29
|
}
|
|
30
30
|
this.active = false;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
32
|
+
logDuration(message, startTime, titleColor = chalk.cyanBright) {
|
|
33
|
+
const duration = Timer.currentTime - startTime;
|
|
34
|
+
this.log(`${titleColor(message)}: ${duration.toFixed(1)}ms`);
|
|
36
35
|
}
|
|
37
36
|
logTitledMessage(title, content, titleColor = chalk.cyanBright) {
|
|
37
|
+
this.log(`${titleColor(title)}: ${content}`);
|
|
38
|
+
}
|
|
39
|
+
log(message) {
|
|
38
40
|
if (currentActiveLogger == this || currentActiveLogger == null) {
|
|
39
|
-
logToStderr(
|
|
41
|
+
logToStderr(message);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
write(message) {
|
|
@@ -44,10 +46,6 @@ export class Logger {
|
|
|
44
46
|
writeToStderr(message);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
|
-
logDuration(message, startTime, titleColor = chalk.cyanBright) {
|
|
48
|
-
const duration = Timer.currentTime - startTime;
|
|
49
|
-
this.log(`${titleColor(message)}: ${duration.toFixed(1)}ms`);
|
|
50
|
-
}
|
|
51
49
|
getTimestamp() {
|
|
52
50
|
return Timer.currentTime;
|
|
53
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/utilities/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,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,GAAG,KAAK,CAAC,UAAU;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,GAAG,SAAS,CAAA;QAE9C,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAC7D,CAAC;IAED,gBAAgB,CAAC,KAAa,EAAE,OAAe,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU;QAC7E,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,GAAG,CAAC,OAAY;QACf,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,IAAI,IAAI,EAAE;YAC/D,WAAW,CAAC,OAAO,CAAC,CAAA;SACpB;IACF,CAAC;IAED,KAAK,CAAC,OAAY;QACjB,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,IAAI,IAAI,EAAE;YAC/D,aAAa,CAAC,OAAO,CAAC,CAAA;SACtB;IACF,CAAC;IAED,YAAY;QACX,OAAO,KAAK,CAAC,WAAW,CAAA;IACzB,CAAC;CACD;AAED,MAAM,UAAU,iBAAiB;IAChC,mBAAmB,GAAG,IAAI,CAAA;AAC3B,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export function extendDeep(base, extension) {
|
|
2
|
+
const baseClone = deepClone(base);
|
|
3
|
+
if (isPlainObject(base) && extension === undefined) {
|
|
4
|
+
return baseClone;
|
|
5
|
+
}
|
|
2
6
|
const extensionClone = deepClone(extension);
|
|
3
7
|
if (!isPlainObject(base) || !isPlainObject(extension)) {
|
|
4
8
|
return extensionClone;
|
|
5
9
|
}
|
|
6
|
-
const baseClone = deepClone(base);
|
|
7
10
|
for (const propName in extensionClone) {
|
|
8
11
|
if (!extensionClone.hasOwnProperty(propName)) {
|
|
9
12
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectUtilities.js","sourceRoot":"","sources":["../../src/utilities/ObjectUtilities.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,IAAS,EAAE,SAAc;IACnD,MAAM,
|
|
1
|
+
{"version":3,"file":"ObjectUtilities.js","sourceRoot":"","sources":["../../src/utilities/ObjectUtilities.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,IAAS,EAAE,SAAc;IACnD,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAEjC,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,SAAS,KAAK,SAAS,EAAE;QACnD,OAAO,SAAS,CAAA;KAChB;IAED,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,CAAA;IAC3C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;QACtD,OAAO,cAAc,CAAA;KACrB;IAED,KAAK,MAAM,QAAQ,IAAI,cAAc,EAAE;QACtC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;YAC7C,SAAQ;SACR;QAED,SAAS,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAA;KAC/E;IAED,OAAO,SAAS,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,GAAM;IACrC,OAAO,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,GAAM;IAClC,OAAO,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;AACxB,CAAC;AAED,SAAS,KAAK,CAAI,GAAM,EAAE,IAAI,GAAG,IAAI,EAAE,cAAqB,EAAE;IAC7D,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;Q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AAU,aAAa,CAAC,GAAQ;IACrC,OAAO,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB,CAAA;AAC1F,CAAC"}
|
|
@@ -46,5 +46,7 @@ export function resolveVersionTagForUnversionedPackageName(unversionedPackageNam
|
|
|
46
46
|
}
|
|
47
47
|
const basePackageUrl = "https://huggingface.co/echogarden/echogarden-packages/resolve/main/";
|
|
48
48
|
const defaultVersionTag = "20230718";
|
|
49
|
-
const packageVersionTagResolutionLookup = {
|
|
49
|
+
const packageVersionTagResolutionLookup = {
|
|
50
|
+
"sox-14.4.2-linux-minimal": "20230802"
|
|
51
|
+
};
|
|
50
52
|
//# sourceMappingURL=PackageManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageManager.js","sourceRoot":"","sources":["../../src/utilities/PackageManager.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG1C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAmB;IACpD,WAAW,GAAG,qCAAqC,CAAC,WAAW,CAAC,CAAA;IAEhE,MAAM,YAAY,GAAG,MAAM,uBAAuB,EAAE,CAAA;IAEpD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;IAExD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE;QAC5B,OAAO,WAAW,CAAA;KAClB;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAEvC,MAAM,OAAO,GAAG,EACf,C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AAC,GAAG,CAAC,CAAA;YAEjC,IAAI,WAA+B,CAAA;YACnC,IAAI,SAA6B,CAAA;YAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC1C,IAAI,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;gBAE3B,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;gBAE1D,IAAI,cAAc,IAAI,CAAC,CAAC,EAAE;oBACzB,SAAQ;iBACR;gBAED,aAAa,GAAG,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;gBAEpD,IAAI,CAAC,IAAI,CAAC,EAAE;oBACX,WAAW,GAAG,cAAc,CAAA;iBAC5B;gBAED,SAAS,GAAG,aAAa,CAAA;aACzB;YAED,KAAK,CAAC,gBAAgB,GAAG,WAAW,CAAA;YACpC,KAAK,CAAC,cAAc,GAAG,SAAS,CAAA;YAEhC,KAAK,CAAC,gBAAgB,GAAG,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACpF,KAAK,CAAC,cAAc,GAAG,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;SAC9E;aAAM,IAAI,KAAK,CAAC,QAAQ,EAAE;YAC1B,aAAa,GAAG,4BAA4B,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;SACjF;KACD;IAED,OAAO,aAAa,CAAA;AACrB,CAAC"}
|
package/docs/API.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# API reference
|
|
2
|
+
|
|
3
|
+
This is a reference for the main methods available in both the JavaScript/TypeScript API and WebSocket messaging-based API.
|
|
4
|
+
|
|
5
|
+
**Note**: the API is not stable yet. It may change at every new version. There are many methods, types and internal data structures that are not yet exposed.
|
|
6
|
+
|
|
7
|
+
### Importing as a Node.js module
|
|
8
|
+
To import the `echograden` package as a Node.js module:
|
|
9
|
+
|
|
10
|
+
Install as a dependency in your project:
|
|
11
|
+
```bash
|
|
12
|
+
npm install echogarden
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Import with:
|
|
16
|
+
```ts
|
|
17
|
+
import * as Echogarden from 'echogarden'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
All methods, properties and arguments have TypeScript type information. You can use it to get more detailed and up-to-date type information that may not be covered in the documentation.
|
|
21
|
+
|
|
22
|
+
### Related resources
|
|
23
|
+
* [Options reference](Options.md)
|
|
24
|
+
* [A comprehensive list of all supported engines](Engines.md)
|
|
25
|
+
* [A quick guide for using the command line interface](CLI.md)
|
|
26
|
+
* [Guide for running and interfacing with a WebSocket server](Server.md)
|
|
27
|
+
|
|
28
|
+
## Synthesis
|
|
29
|
+
|
|
30
|
+
### `synthesize(input, options, onSegment, onSentence)`
|
|
31
|
+
|
|
32
|
+
Synthesizes the given input.
|
|
33
|
+
|
|
34
|
+
* `input`: Text to synthesize, can be a `string`, or a `string[]`. When given an array of strings, the elements of the array would be seen as predefined segments (this is useful if you would like to have more control over how segments are split, or your input has a special format requiring a custom splitting method).
|
|
35
|
+
* `options`: Synthesis options object
|
|
36
|
+
* `onSegment`: A callback that is called whenever a segment has been synthesized (optional)
|
|
37
|
+
* `onSentence`: A callback that is called whenever a sentence has been synthesized (optional)
|
|
38
|
+
|
|
39
|
+
#### Returns (via promise):
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
{
|
|
43
|
+
audio: RawAudio | Buffer
|
|
44
|
+
timeline: Timeline
|
|
45
|
+
language: string
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`audio` may either be a
|
|
50
|
+
* `RawAudio` object, which is a structure containing the sample rate and raw 32-bit float channels:
|
|
51
|
+
```ts
|
|
52
|
+
{
|
|
53
|
+
sampleRate: number
|
|
54
|
+
channels: Float32Array[]
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
* A `Buffer` containing the audio in encoded form, in the case a particular codec was specified in the `outputAudioFormat.codec` option.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
#### Segment and sentence event callbacks
|
|
61
|
+
|
|
62
|
+
You can optionally pass two `async` callbacks to `synthesize`, `onSegment` and `onSentence`.
|
|
63
|
+
|
|
64
|
+
For example:
|
|
65
|
+
```ts
|
|
66
|
+
async function onSegment(data: SynthesisSegmentEventData) {
|
|
67
|
+
console.log(data.transcript)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const { audio } = await Echogarden.synthesize("Hello World!", { engine: 'espeak' }, onSegment)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`SynthesisSegmentEventData` is an object with the structure:
|
|
74
|
+
```ts
|
|
75
|
+
{
|
|
76
|
+
index: number // Index of part
|
|
77
|
+
total: number // Total number of parts
|
|
78
|
+
audio: RawAudio | Buffer // Audio for parts
|
|
79
|
+
timeline: Timeline // Timeline for part
|
|
80
|
+
transcript: string // Transcript for part
|
|
81
|
+
language: string // Language for part
|
|
82
|
+
peakDecibelsSoFar: number // Peak decibels measured for all synthesized audio, so far
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### `requestVoiceList(options)`
|
|
87
|
+
|
|
88
|
+
Request a list of voices for a particular engine.
|
|
89
|
+
|
|
90
|
+
* `options`: Voice list request options object
|
|
91
|
+
|
|
92
|
+
#### Returns (via promise):
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
{
|
|
96
|
+
voiceList: SynthesisVoice[]
|
|
97
|
+
bestMatchingVoice: SynthesisVoice
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Recognition
|
|
102
|
+
|
|
103
|
+
### `recognize(input, options)`
|
|
104
|
+
|
|
105
|
+
* `input`: Can be an audio file path (`string`), encoded audio (`Buffer` or `Uint8array`) or a raw audio object (`RawAudio`)
|
|
106
|
+
* `options`: Recognition options object
|
|
107
|
+
|
|
108
|
+
#### Returns (via promise):
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
{
|
|
112
|
+
transcript: string
|
|
113
|
+
timeline: Timeline
|
|
114
|
+
wordTimeline: Timeline
|
|
115
|
+
language: string
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Alignment
|
|
120
|
+
|
|
121
|
+
### `align(input, transcript, options)`
|
|
122
|
+
|
|
123
|
+
* `input`: Can be an audio file path (`string`), encoded audio (`Buffer` or `Uint8array`) or a raw audio object (`RawAudio`)
|
|
124
|
+
* `options`: Alignment options object
|
|
125
|
+
|
|
126
|
+
#### Returns (via promise):
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
{
|
|
130
|
+
timeline: Timeline
|
|
131
|
+
wordTimeline: Timeline
|
|
132
|
+
transcript: string
|
|
133
|
+
language: string
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Speech translation
|
|
138
|
+
|
|
139
|
+
### `translateSpeech(input, options)`
|
|
140
|
+
|
|
141
|
+
* `input`: Can be an audio file path (`string`), encoded audio (`Buffer` or `Uint8array`) or a raw audio object (`RawAudio`)
|
|
142
|
+
* `options`: Speech translation options object
|
|
143
|
+
|
|
144
|
+
#### Returns (via promise):
|
|
145
|
+
```ts
|
|
146
|
+
{
|
|
147
|
+
transcript: string
|
|
148
|
+
timeline: Timeline
|
|
149
|
+
wordTimeline: Timeline
|
|
150
|
+
sourceLanguage: string
|
|
151
|
+
targetLanguage: string
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Language detection
|
|
156
|
+
|
|
157
|
+
### `detectSpeechLanguage(input, options)`
|
|
158
|
+
|
|
159
|
+
* `input`: Can be an audio file path (`string`), encoded audio (`Buffer` or `Uint8array`) or a raw audio object (`RawAudio`)
|
|
160
|
+
* `options`: Speech language detection options object
|
|
161
|
+
|
|
162
|
+
#### Returns (via promise):
|
|
163
|
+
```ts
|
|
164
|
+
{
|
|
165
|
+
detectedLanguage: string
|
|
166
|
+
detectedLanguageName: string
|
|
167
|
+
detectedLanguageProbabilities: LanguageDetectionResults
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `detectTextLanguage(input, options)`
|
|
172
|
+
|
|
173
|
+
* `input`: Input text as `string`
|
|
174
|
+
* `options`: Text language detection options object
|
|
175
|
+
|
|
176
|
+
#### Returns (via promise):
|
|
177
|
+
```ts
|
|
178
|
+
{
|
|
179
|
+
detectedLanguage: string
|
|
180
|
+
detectedLanguageName: string
|
|
181
|
+
detectedLanguageProbabilities: LanguageDetectionResults
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Voice activity detection
|
|
186
|
+
|
|
187
|
+
### `detectVoiceActivity(input, options)`
|
|
188
|
+
|
|
189
|
+
* `input`: Can be an audio file path (`string`), encoded audio (`Buffer` or `Uint8array`) or a raw audio object (`RawAudio`)
|
|
190
|
+
* `options`: Voice activity detection options object
|
|
191
|
+
|
|
192
|
+
#### Returns (via promise):
|
|
193
|
+
```ts
|
|
194
|
+
{
|
|
195
|
+
timeline: Timeline
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Denoising
|
|
200
|
+
|
|
201
|
+
### `denoise(input, options)`
|
|
202
|
+
|
|
203
|
+
* `input`: Can be an audio file path (`string`), encoded audio (`Buffer` or `Uint8array`) or a raw audio object (`RawAudio`)
|
|
204
|
+
* `options`: Denoising options object
|
|
205
|
+
|
|
206
|
+
#### Returns (via promise):
|
|
207
|
+
```ts
|
|
208
|
+
{
|
|
209
|
+
denoisedAudio: RawAudio
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## TODO
|
|
214
|
+
|
|
215
|
+
Expose more methods that may be useful for developers, like subtitle manipulation, phonemization, etc.
|
package/docs/Options.md
CHANGED
|
@@ -5,10 +5,11 @@ Here is a detailed reference for the options accepted by the Echogarden API and
|
|
|
5
5
|
**Related resources**:
|
|
6
6
|
* [A comprehensive list of all supported engines](Engines.md)
|
|
7
7
|
* [A quick guide for using the command line interface](CLI.md)
|
|
8
|
+
* [Developer's API reference](API.md)
|
|
8
9
|
|
|
9
10
|
## Synthesis
|
|
10
11
|
|
|
11
|
-
Applicable to CLI commands: `speak`, `speak-file`, `speak-url`, `speak-wikipedia
|
|
12
|
+
Applicable to CLI commands: `speak`, `speak-file`, `speak-url`, `speak-wikipedia`, API method: `synthesize`
|
|
12
13
|
|
|
13
14
|
**General**:
|
|
14
15
|
* `engine`: identifier of the synthesis engine to use, such as `espeak` or `vits`.
|
|
@@ -39,6 +40,10 @@ Applicable to CLI commands: `speak`, `speak-file`, `speak-url`, `speak-wikipedia
|
|
|
39
40
|
* `postProcessing.timePitchShiftingMethod`: method for time and pitch shifting. Can be `sonic` or `rubberband`. Defaults to `sonic`
|
|
40
41
|
* `postProcessing.rubberband`: prefix for RubberBand options (TODO)
|
|
41
42
|
|
|
43
|
+
**Output audio format**:
|
|
44
|
+
* `outputAudioFormat.codec`: Codec identifier (**Note**: API only! CLI uses file extension instead), can be `wav`, `mp3`, `opus`, `m4a`, `ogg`, `flac`. Leaving as `undefined` would return a raw audio structure (see more information at the API documentation). Optional
|
|
45
|
+
* `outputAudioFormat.bitrate`: Custom bitrate for encoding, applies only to `mp3`, `opus`, `m4a`, `ogg`. By default, bitrates are selected between 48Kbps and 64Kbps, to provide a good speech quality while minimizing file size. Optional
|
|
46
|
+
|
|
42
47
|
**Subtitles**
|
|
43
48
|
* `subtitles.maxLineCount`: maximum number of lines per cue. Defaults to `2`
|
|
44
49
|
* `subtitles.maxLineWidth`: maximum characters in a line. Defaults to `42`
|
|
@@ -99,9 +104,24 @@ Applicable to CLI commands: `speak`, `speak-file`, `speak-url`, `speak-wikipedia
|
|
|
99
104
|
* `microsoftEdge.trustedClientToken`: trusted client token (required). A special token required to use the service
|
|
100
105
|
* `microsoftEdge.pitchDeltaHz`: pitch delta in Hz. Overrides `pitch` when set
|
|
101
106
|
|
|
107
|
+
## Voice list request
|
|
108
|
+
|
|
109
|
+
Applicable to CLI command: `list-voices`, API method: `requestVoiceList`
|
|
110
|
+
|
|
111
|
+
**General**
|
|
112
|
+
* `language`: language code to filter by (optional)
|
|
113
|
+
* `voice`: name or name pattern to filter by (optional)
|
|
114
|
+
* `voiceGender`: gender to filter by (optional)
|
|
115
|
+
|
|
116
|
+
Also accepted are engine-specific options that may be required in order to retrieve the voice list, especially for cloud engines. Examples:
|
|
117
|
+
* `googleCloud.apiKey`
|
|
118
|
+
* `microsoftAzure.subscriptionKey`, `microsoftAzure.serviceRegion`
|
|
119
|
+
* `amazonPolly.region`, `amazonPolly.accessKeyId`, `amazonPolly.secretAccessKey`
|
|
120
|
+
* `elevenLabs.apiKey`
|
|
121
|
+
|
|
102
122
|
## Recognition
|
|
103
123
|
|
|
104
|
-
Applicable to CLI command: `transcribe
|
|
124
|
+
Applicable to CLI command: `transcribe`, API method: `recognize`
|
|
105
125
|
|
|
106
126
|
**General**:
|
|
107
127
|
* `engine`: identifier of the recognition engine to use, such as `whisper` or `vosk`
|
|
@@ -146,7 +166,7 @@ Applicable to CLI command: `transcribe`.
|
|
|
146
166
|
|
|
147
167
|
## Alignment
|
|
148
168
|
|
|
149
|
-
Applicable to CLI command: `align
|
|
169
|
+
Applicable to CLI command: `align`, API method: `align`
|
|
150
170
|
|
|
151
171
|
**General**:
|
|
152
172
|
* `engine`: what alignment algorithm to use, can be `dtw`, `dtw-ra` or `whisper`. Defaults to `dtw`
|
|
@@ -175,7 +195,7 @@ Applicable to CLI command: `align`.
|
|
|
175
195
|
|
|
176
196
|
## Speech translation
|
|
177
197
|
|
|
178
|
-
Applicable to CLI command: `translate-speech
|
|
198
|
+
Applicable to CLI command: `translate-speech`, API method: `translateSpeech`
|
|
179
199
|
|
|
180
200
|
**General**:
|
|
181
201
|
* `engine`: only `whisper` supported
|
|
@@ -191,22 +211,24 @@ Applicable to CLI command: `translate-speech`.
|
|
|
191
211
|
|
|
192
212
|
### Speech language detection
|
|
193
213
|
|
|
194
|
-
Applicable to CLI command: `detect-speech-langauge
|
|
214
|
+
Applicable to CLI command: `detect-speech-langauge`, API method: `detectSpeechLangauge`
|
|
195
215
|
|
|
216
|
+
**General**:
|
|
196
217
|
* `engine`: `silero` or `whisper`. Defaults to `silero`
|
|
197
218
|
* `whisper`: whisper options prefix, can be used like `whisper.model = base` to set options for the Whisper engine. See Whisper options on the recognition section
|
|
198
219
|
|
|
199
220
|
### Text language detection
|
|
200
221
|
|
|
201
|
-
Applicable to CLI command: `detect-text-langauge
|
|
222
|
+
Applicable to CLI command: `detect-text-langauge`, API method: `detectTextLangauge`
|
|
202
223
|
|
|
224
|
+
**General**:
|
|
203
225
|
* `engine`: `tinyld` or `fasttext`. Defaults to `tinyld`
|
|
204
226
|
* `defaultLanguage`: language to fall back to when confidence of is low. Defaults to `en`
|
|
205
227
|
* `fallbackThresholdProbability`: confidence threshold to cause fallback. Defaults to `0.05`
|
|
206
228
|
|
|
207
229
|
## Voice activity detection
|
|
208
230
|
|
|
209
|
-
Applicable to CLI command: `detect-voice-activity
|
|
231
|
+
Applicable to CLI command: `detect-voice-activity`, API method: `detectVoiceActivity`
|
|
210
232
|
|
|
211
233
|
**General**:
|
|
212
234
|
* `engine`: VAD engine to use. Can be `webrtc`, `silero` or `rnnoise`. Defaults to `webrtc`
|
|
@@ -221,7 +243,7 @@ Applicable to CLI command: `detect-voice-activity`.
|
|
|
221
243
|
|
|
222
244
|
## Speech denoising
|
|
223
245
|
|
|
224
|
-
Applicable to CLI command: `denoise
|
|
246
|
+
Applicable to CLI command: `denoise`, API method: `denoise`
|
|
225
247
|
|
|
226
248
|
**General**:
|
|
227
249
|
* `engine`: can only be `rnnoise`
|
|
@@ -231,18 +253,3 @@ Applicable to CLI command: `denoise`.
|
|
|
231
253
|
* `postProcessing.targetPeakDb`: target peak (decibels) for normalization. Defaults to `-3`
|
|
232
254
|
* `postProcessing.maxIncreaseDb`: max gain increase (decibels) when performing normalization. Defaults to `30`
|
|
233
255
|
* `postProcessing.dryMixGainDb`: gain (decibels) of dry (original) signal to mix back to the denoised output. Defaults to `-20`
|
|
234
|
-
|
|
235
|
-
## Voice list request
|
|
236
|
-
|
|
237
|
-
Applicable to CLI command: `list-voices`.
|
|
238
|
-
|
|
239
|
-
**General**
|
|
240
|
-
* `language`: language code to filter by (optional)
|
|
241
|
-
* `voice`: name or name pattern to filter by (optional)
|
|
242
|
-
* `voiceGender`: gender to filter by (optional)
|
|
243
|
-
|
|
244
|
-
Also accepted are engine-specific options that may be required in order to retrieve the voice list, especially for cloud engines. Examples:
|
|
245
|
-
* `googleCloud.apiKey`
|
|
246
|
-
* `microsoftAzure.subscriptionKey`, `microsoftAzure.serviceRegion`
|
|
247
|
-
* `amazonPolly.region`, `amazonPolly.accessKeyId`, `amazonPolly.secretAccessKey`
|
|
248
|
-
* `elevenLabs.apiKey`, `elevenLabs.modelId`
|
package/docs/Server.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Starting and interfacing with the WebSocket server
|
|
2
|
+
|
|
3
|
+
This is a guide for the WebSocket server protocol. The protocol is still in an early development stage and may change in future releases.
|
|
4
|
+
|
|
5
|
+
## Starting the server
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
echogarden serve [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Options** (all optional):
|
|
12
|
+
* `port`: Port number. Defaults to `45054`
|
|
13
|
+
* `secure`: Start a secure server? Defaults to `false`
|
|
14
|
+
* `certPath`: Path to a certificate file, required when `secure = true`
|
|
15
|
+
* `keyPath`: Path to a private key file, required when `secure = true`
|
|
16
|
+
* `deflate`: Use per-message deflate. Defaults to `true`
|
|
17
|
+
* `maxPayload`: Maximum raw message payload size (in bytes). Defaults to `1000 * 1000000` (1GB)
|
|
18
|
+
* `useWorkerThread`: Run worker in a separate thread. Defaults to `true` (recommended to leave as is)
|
|
19
|
+
|
|
20
|
+
## Using the client class
|
|
21
|
+
|
|
22
|
+
For Node.js clients, a simple client class allows to wrap communications with with the server in a more convenient interface, without needing to know the details of the protocol.
|
|
23
|
+
|
|
24
|
+
Currently, the client is is embedded in the main codebase. This means you have to import the `echogarden` package to use it:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { WebSocket } from 'ws'
|
|
28
|
+
import { Client } from 'echogarden'
|
|
29
|
+
|
|
30
|
+
const ws = new WebSocket('ws://localhost:45054')
|
|
31
|
+
|
|
32
|
+
ws.on("open", async () => {
|
|
33
|
+
const client = new Client(ws)
|
|
34
|
+
|
|
35
|
+
const { audio } = await client.synthesize("Hello World", { engine: 'espeak' })
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
In the future, this module may be separated to an independent lightweight package.
|
|
40
|
+
|
|
41
|
+
**TODO**: add support for cancelation signals in client class.
|
|
42
|
+
|
|
43
|
+
## Protocol details
|
|
44
|
+
|
|
45
|
+
The protocol is based on binary WebSocket messages, for both request and response objects. Messages are encoded using the [MessagePack](https://msgpack.org/index.html) encoding scheme.
|
|
46
|
+
|
|
47
|
+
All messages are objects and have the basic structure:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
{
|
|
51
|
+
messageType: string
|
|
52
|
+
requestId: string
|
|
53
|
+
|
|
54
|
+
// ... other data specific for the target message type
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The `messageType` property is a string representing the operation to perform. These operations are parallel to the methods provided by the Node.js API. They can be one of:
|
|
59
|
+
|
|
60
|
+
* `SynthesisRequest`
|
|
61
|
+
* `VoiceListRequest`
|
|
62
|
+
* `RecognitionRequest`
|
|
63
|
+
* `AlignmentRequest`
|
|
64
|
+
* `SpeechTranslationRequest`
|
|
65
|
+
* `SpeechLanguageDetectionRequest`
|
|
66
|
+
* `TextLanguageDetectionRequest`
|
|
67
|
+
|
|
68
|
+
When sending a message, `requestId` should contain a long random string that uniquely identifies your request, like `cb7e0f3ec835a213b005c4424c8d5775`.
|
|
69
|
+
|
|
70
|
+
For example, this message requests synthesis:
|
|
71
|
+
```ts
|
|
72
|
+
{
|
|
73
|
+
messageType: 'SynthesisRequest',
|
|
74
|
+
requestId: 'cb7e0f3ec835a213b005c4424c8d5775',
|
|
75
|
+
|
|
76
|
+
input: 'Hello World!',
|
|
77
|
+
|
|
78
|
+
options: {
|
|
79
|
+
engine: 'espeak',
|
|
80
|
+
voice: 'en-GB'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
After a message is sent, the server may send one or more response messages. Each response message includes the `requestId` identifier that was given on the request it replies to. The response message `messageType` can be:
|
|
86
|
+
|
|
87
|
+
* `SynthesisResponse`, `SynthesisSegmentEvent`, `SynthesisSentenceEvent`
|
|
88
|
+
* `VoiceListResponse`
|
|
89
|
+
* `RecognitionResponse`
|
|
90
|
+
* `AlignmentResponse`
|
|
91
|
+
* `SpeechTranslationResponse`
|
|
92
|
+
* `SpeechLanguageDetectionResponse`
|
|
93
|
+
* `TextLanguageDetectionResponse`
|
|
94
|
+
|
|
95
|
+
The properties included in the response objects, are similar to the ones returned by the API.
|
|
96
|
+
|
|
97
|
+
Example response, for the above synthesis request:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
{
|
|
101
|
+
messageType: 'SynthesisResponse',
|
|
102
|
+
requestId: 'cb7e0f3ec835a213b005c4424c8d5775',
|
|
103
|
+
|
|
104
|
+
audio: {
|
|
105
|
+
sampleRate: 22050,
|
|
106
|
+
channels: [ ... ] // An array of `Float32Array` channel data
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ... other result object properties
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Cancelation messages
|
|
114
|
+
|
|
115
|
+
To cancel an existing request, the client can send a `CancelationRequest` message, with the same `requestId` of an ongoing request, like:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
{
|
|
119
|
+
messageType: 'CancelationRequest',
|
|
120
|
+
requestId: 'cb7e0f3ec835a213b005c4424c8d5775'
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Starting the server programmatically
|
|
125
|
+
|
|
126
|
+
You can use the `startServer` method to start a new server.
|
|
127
|
+
```ts
|
|
128
|
+
async function startServer(serverOptions: ServerOptions, onStarted: (options: ServerOptions) => void)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Example:
|
|
132
|
+
```ts
|
|
133
|
+
import { startServer } from 'echogarden'
|
|
134
|
+
|
|
135
|
+
startServer({ port: 1234 }, () => {
|
|
136
|
+
console.log("Server is started!")
|
|
137
|
+
})
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The method would return when the server is closed.
|
|
141
|
+
|
|
142
|
+
**TODO**: accept a signal to stop the server.
|
|
143
|
+
|
|
144
|
+
## Web-based user interface (future)
|
|
145
|
+
|
|
146
|
+
When an HTTP web-based user interface is developed, it would be integrated with the WebSocket server and share the same port.
|
|
147
|
+
|
|
148
|
+
Currently, if you start a non-secure server and try to open `http://localhost:45054` (or another port you specified), you should see a placeholder message saying:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
This is the Echogarden HTTP server!
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
If you can't see this message, there may be a configuration issue, or some other problem.
|
|
155
|
+
|
|
156
|
+
## TODO
|
|
157
|
+
|
|
158
|
+
Expose more operations to the server.
|