speechflow 1.2.8 → 1.3.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/README.md +201 -43
- package/dst/speechflow-node-a2a-gender.d.ts +1 -0
- package/dst/speechflow-node-a2a-gender.js +7 -2
- package/dst/speechflow-node-a2a-gender.js.map +1 -1
- package/dst/speechflow-node-a2a-meter.js +5 -2
- package/dst/speechflow-node-a2a-meter.js.map +1 -1
- package/dst/speechflow-node-a2t-deepgram.js +22 -14
- package/dst/speechflow-node-a2t-deepgram.js.map +1 -1
- package/dst/speechflow-node-t2t-sentence.d.ts +17 -0
- package/dst/speechflow-node-t2t-sentence.js +234 -0
- package/dst/speechflow-node-t2t-sentence.js.map +1 -0
- package/dst/speechflow-node-t2t-subtitle.d.ts +1 -0
- package/dst/speechflow-node-t2t-subtitle.js +231 -51
- package/dst/speechflow-node-t2t-subtitle.js.map +1 -1
- package/dst/speechflow-node-x2x-trace.js +14 -7
- package/dst/speechflow-node-x2x-trace.js.map +1 -1
- package/dst/speechflow-node-xio-device.js +10 -2
- package/dst/speechflow-node-xio-device.js.map +1 -1
- package/dst/speechflow-node.d.ts +2 -0
- package/dst/speechflow-node.js +3 -0
- package/dst/speechflow-node.js.map +1 -1
- package/dst/speechflow-utils.js +1 -1
- package/dst/speechflow-utils.js.map +1 -1
- package/dst/speechflow.js +64 -2
- package/dst/speechflow.js.map +1 -1
- package/etc/speechflow.yaml +39 -26
- package/package.json +18 -17
- package/src/speechflow-node-a2a-gender.ts +8 -2
- package/src/speechflow-node-a2a-meter.ts +1 -1
- package/src/speechflow-node-a2t-deepgram.ts +18 -11
- package/src/speechflow-node-t2t-sentence.ts +224 -0
- package/src/speechflow-node-t2t-subtitle.ts +62 -15
- package/src/speechflow-node-xio-device.ts +10 -2
- package/src/speechflow-utils.ts +1 -1
- package/src/speechflow.ts +15 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
ChangeLog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
1.3.1 (2025-07-31)
|
|
6
|
+
------------------
|
|
7
|
+
|
|
8
|
+
- BUGFIX: wait a longer time for "deepgram" node to open
|
|
9
|
+
- IMPROVEMENT: keep word information as meta information in "deepgram" node
|
|
10
|
+
- IMPROVEMENT: support words in subtitle generation in "subtitle" node
|
|
11
|
+
- BUGFIX: fix WebVTT format generation in "subtitle" node
|
|
12
|
+
- UPGRADE: upgrade NPM dependencies
|
|
13
|
+
|
|
14
|
+
1.3.0 (2025-07-26)
|
|
15
|
+
------------------
|
|
16
|
+
|
|
17
|
+
- IMPROVEMENT: add new "sentence" node for sentence splitting/merging
|
|
18
|
+
- BUGFIX: more robust shutdown in main program
|
|
19
|
+
- BUGFIX: more robust shutdown in "gender" node
|
|
20
|
+
- CLEANUP: log less under "info" log level
|
|
21
|
+
- UPGRADE: upgrade NPM dependencies
|
|
22
|
+
|
|
5
23
|
1.2.8 (2025-07-22)
|
|
6
24
|
------------------
|
|
7
25
|
|
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ local [OPUS/ONNX](https://github.com/Helsinki-NLP/Opus-MT) text-to-text translat
|
|
|
41
41
|
local [FFmpeg](https://ffmpeg.org/) speech-to-speech encoding,
|
|
42
42
|
local WAV speech-to-speech encoding,
|
|
43
43
|
local text-to-text formatting,
|
|
44
|
+
local text-to-text sentencing merging/splitting,
|
|
44
45
|
local text-to-text subtitle generation,
|
|
45
46
|
local text or audio filter, and
|
|
46
47
|
local text or audio tracing.
|
|
@@ -55,14 +56,14 @@ ships as an installable package for the Node Package Manager (NPM).
|
|
|
55
56
|
Installation
|
|
56
57
|
------------
|
|
57
58
|
|
|
58
|
-
```
|
|
59
|
+
```sh
|
|
59
60
|
$ npm install -g speechflow
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
Usage
|
|
63
64
|
-----
|
|
64
65
|
|
|
65
|
-
```
|
|
66
|
+
```sh
|
|
66
67
|
$ speechflow
|
|
67
68
|
[-h|--help]
|
|
68
69
|
[-V|--version]
|
|
@@ -187,27 +188,29 @@ They can also be found in the sample [speechflow.yaml](./etc/speechflow.yaml) fi
|
|
|
187
188
|
wav(mode: "encode") |
|
|
188
189
|
file(path: "program-de.wav", mode: "w", type: "audio"),
|
|
189
190
|
deepgram(language: "de", key: env.SPEECHFLOW_DEEPGRAM_KEY) | {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
191
|
+
sentence() | {
|
|
192
|
+
format(width: 80) |
|
|
193
|
+
file(path: "program-de.txt", mode: "w", type: "text"),
|
|
194
|
+
deepl(src: "de", dst: "en", key: env.SPEECHFLOW_DEEPL_KEY) | {
|
|
195
|
+
trace(name: "text", type: "text") | {
|
|
196
|
+
format(width: 80) |
|
|
197
|
+
file(path: "program-en.txt", mode: "w", type: "text"),
|
|
198
|
+
subtitle(format: "srt") |
|
|
199
|
+
file(path: "program-en.srt", mode: "w", type: "text"),
|
|
200
|
+
mqtt(url: "mqtt://10.1.0.10:1883",
|
|
201
|
+
username: env.SPEECHFLOW_MQTT_USER,
|
|
202
|
+
password: env.SPEECHFLOW_MQTT_PASS,
|
|
203
|
+
topicWrite: "stream/studio/sender"),
|
|
204
|
+
{
|
|
205
|
+
filter(name: "S2T-male", type: "text", var: "meta:gender", op: "==", val: "male") |
|
|
206
|
+
elevenlabs(voice: "Mark", optimize: "latency", speed: 1.05, language: "en"),
|
|
207
|
+
filter(name: "S2T-female", type: "text", var: "meta:gender", op: "==", val: "female") |
|
|
208
|
+
elevenlabs(voice: "Brittney", optimize: "latency", speed: 1.05, language: "en")
|
|
209
|
+
} | {
|
|
210
|
+
wav(mode: "encode") |
|
|
211
|
+
file(path: "program-en.wav", mode: "w", type: "audio"),
|
|
212
|
+
device(device: "coreaudio:USBAudio2.0", mode: "w")
|
|
213
|
+
}
|
|
211
214
|
}
|
|
212
215
|
}
|
|
213
216
|
}
|
|
@@ -248,12 +251,19 @@ First a short overview of the available processing nodes:
|
|
|
248
251
|
**filter**,
|
|
249
252
|
**trace**.
|
|
250
253
|
|
|
251
|
-
### Input/Output Nodes
|
|
254
|
+
### Input/Output Nodes
|
|
255
|
+
|
|
256
|
+
The following nodes are for external I/O, i.e, to read/write from
|
|
257
|
+
external files, devices and network services.
|
|
252
258
|
|
|
253
259
|
- Node: **file**<br/>
|
|
254
260
|
Purpose: **File and StdIO source/sink**<br/>
|
|
255
261
|
Example: `file(path: "capture.pcm", mode: "w", type: "audio")`
|
|
256
262
|
|
|
263
|
+
> This node allows the reading/writing from/to files or from StdIO. It
|
|
264
|
+
> is intended to be used as source and sink nodes in batch processing,
|
|
265
|
+
> and as sing nodes in real-time processing.
|
|
266
|
+
|
|
257
267
|
| Port | Payload |
|
|
258
268
|
| ------- | ----------- |
|
|
259
269
|
| input | text, audio |
|
|
@@ -271,6 +281,10 @@ First a short overview of the available processing nodes:
|
|
|
271
281
|
Purpose: **Microphone/speaker device source/sink**<br/>
|
|
272
282
|
Example: `device(device: "wasapi:VoiceMeeter Out B1", mode: "r")`
|
|
273
283
|
|
|
284
|
+
> This node allows the reading/writing from/to audio devices. It is
|
|
285
|
+
> intended to be used as source nodes for microphone devices and as
|
|
286
|
+
> sink nodes for speaker devices.
|
|
287
|
+
|
|
274
288
|
| Port | Payload |
|
|
275
289
|
| ------- | ----------- |
|
|
276
290
|
| input | audio |
|
|
@@ -287,6 +301,11 @@ First a short overview of the available processing nodes:
|
|
|
287
301
|
Example: `websocket(connect: "ws://127.0.0.1:12345", type: "text")`
|
|
288
302
|
Notice: this node requires a peer WebSocket service!
|
|
289
303
|
|
|
304
|
+
> This node allows reading/writing from/to WebSocket network services.
|
|
305
|
+
> It is primarily intended to be used for sending out the text of
|
|
306
|
+
> subtitles, but can be also used for receiving the text to be
|
|
307
|
+
> processed.
|
|
308
|
+
|
|
290
309
|
| Port | Payload |
|
|
291
310
|
| ------- | ----------- |
|
|
292
311
|
| input | text, audio |
|
|
@@ -303,6 +322,10 @@ First a short overview of the available processing nodes:
|
|
|
303
322
|
Example: `mqtt(url: "mqtt://127.0.0.1:1883", username: "foo", password: "bar", topic: "quux")`
|
|
304
323
|
Notice: this node requires a peer MQTT broker!
|
|
305
324
|
|
|
325
|
+
> This node allows reading/writing from/to MQTT broker topics. It is
|
|
326
|
+
> primarily intended to be used for sending out the text of subtitles,
|
|
327
|
+
> but can be also used for receiving the text to be processed.
|
|
328
|
+
|
|
306
329
|
| Port | Payload |
|
|
307
330
|
| ------- | ----------- |
|
|
308
331
|
| input | text |
|
|
@@ -310,17 +333,23 @@ First a short overview of the available processing nodes:
|
|
|
310
333
|
|
|
311
334
|
| Parameter | Position | Default | Requirement |
|
|
312
335
|
| ------------ | --------- | -------- | --------------------- |
|
|
313
|
-
| **url** | 0 | *none* | `/^(?:\|(?:ws
|
|
336
|
+
| **url** | 0 | *none* | `/^(?:\|(?:ws\|mqtt):\/\/(.+?):(\d+))$/` |
|
|
314
337
|
| **username** | 1 | *none* | `/^.+$/` |
|
|
315
338
|
| **password** | 2 | *none* | `/^.+$/` |
|
|
316
339
|
| **topic** | 3 | *none* | `/^.+$/` |
|
|
317
340
|
|
|
318
|
-
### Audio-to-Audio Nodes
|
|
341
|
+
### Audio-to-Audio Nodes
|
|
342
|
+
|
|
343
|
+
The following nodes process audio chunks only.
|
|
319
344
|
|
|
320
345
|
- Node: **ffmpeg**<br/>
|
|
321
346
|
Purpose: **FFmpeg audio format conversion**<br/>
|
|
322
347
|
Example: `ffmpeg(src: "pcm", dst: "mp3")`
|
|
323
348
|
|
|
349
|
+
> This node allows converting between audio formats. It is primarily
|
|
350
|
+
> intended to support the reading/writing of external MP3 and Opus
|
|
351
|
+
> format files, although SpeechFlow internally uses PCM format only.
|
|
352
|
+
|
|
324
353
|
| Port | Payload |
|
|
325
354
|
| ------- | ----------- |
|
|
326
355
|
| input | audio |
|
|
@@ -335,6 +364,10 @@ First a short overview of the available processing nodes:
|
|
|
335
364
|
Purpose: **WAV audio format conversion**<br/>
|
|
336
365
|
Example: `wav(mode: "encode")`
|
|
337
366
|
|
|
367
|
+
> This node allows converting between PCM and WAV audio formats. It is
|
|
368
|
+
> primarily intended to support the reading/writing of external WAV
|
|
369
|
+
> format files, although SpeechFlow internally uses PCM format only.
|
|
370
|
+
|
|
338
371
|
| Port | Payload |
|
|
339
372
|
| ------- | ----------- |
|
|
340
373
|
| input | audio |
|
|
@@ -349,6 +382,9 @@ First a short overview of the available processing nodes:
|
|
|
349
382
|
Example: `mute()`
|
|
350
383
|
Notice: this node has to be externally controlled via REST/WebSockets!
|
|
351
384
|
|
|
385
|
+
> This node allows muting the audio stream by either silencing or even
|
|
386
|
+
> unplugging. It has to be externally controlled via REST/WebSocket (see below).
|
|
387
|
+
|
|
352
388
|
| Port | Payload |
|
|
353
389
|
| ------- | ----------- |
|
|
354
390
|
| input | audio |
|
|
@@ -361,6 +397,10 @@ First a short overview of the available processing nodes:
|
|
|
361
397
|
Purpose: **Loudness metering node**<br/>
|
|
362
398
|
Example: `meter(250)`
|
|
363
399
|
|
|
400
|
+
> This node allows measuring the loudness of the audio stream. The
|
|
401
|
+
> results are emitted to both the logfile of **SpeechFlow** and the
|
|
402
|
+
> WebSockets API (see below).
|
|
403
|
+
|
|
364
404
|
| Port | Payload |
|
|
365
405
|
| ------- | ----------- |
|
|
366
406
|
| input | audio |
|
|
@@ -374,6 +414,10 @@ First a short overview of the available processing nodes:
|
|
|
374
414
|
Purpose: **Voice Audio Detection (VAD) node**<br/>
|
|
375
415
|
Example: `vad()`
|
|
376
416
|
|
|
417
|
+
> This node perform Voice Audio Detection (VAD), i.e., it detects
|
|
418
|
+
> voice in the audio stream and if not detected either silences or
|
|
419
|
+
> unplugs the audio stream.
|
|
420
|
+
|
|
377
421
|
| Port | Payload |
|
|
378
422
|
| ------- | ----------- |
|
|
379
423
|
| input | audio |
|
|
@@ -381,7 +425,7 @@ First a short overview of the available processing nodes:
|
|
|
381
425
|
|
|
382
426
|
| Parameter | Position | Default | Requirement |
|
|
383
427
|
| ----------- | --------- | -------- | ------------------------ |
|
|
384
|
-
| **mode** | *none* | "unplugged" | `/^(?:silenced
|
|
428
|
+
| **mode** | *none* | "unplugged" | `/^(?:silenced\|unplugged)$/` |
|
|
385
429
|
| **posSpeechThreshold** | *none* | 0.50 | *none* |
|
|
386
430
|
| **negSpeechThreshold** | *none* | 0.35 | *none* |
|
|
387
431
|
| **minSpeechFrames** | *none* | 2 | *none* |
|
|
@@ -393,6 +437,10 @@ First a short overview of the available processing nodes:
|
|
|
393
437
|
Purpose: **Gender Detection node**<br/>
|
|
394
438
|
Example: `gender()`
|
|
395
439
|
|
|
440
|
+
> This node performs gender detection on the audio stream. It
|
|
441
|
+
> annotates the audio chunks with `gender=male` or `gender=female`
|
|
442
|
+
> meta information. Use this meta information with the "filter" node.
|
|
443
|
+
|
|
396
444
|
| Port | Payload |
|
|
397
445
|
| ------- | ----------- |
|
|
398
446
|
| input | audio |
|
|
@@ -402,13 +450,19 @@ First a short overview of the available processing nodes:
|
|
|
402
450
|
| ----------- | --------- | -------- | ------------------------ |
|
|
403
451
|
| **window** | 0 | 500 | *none* |
|
|
404
452
|
|
|
405
|
-
### Audio-to-Text Nodes
|
|
453
|
+
### Audio-to-Text Nodes
|
|
454
|
+
|
|
455
|
+
The following nodes convert audio to text chunks.
|
|
406
456
|
|
|
407
457
|
- Node: **deepgram**<br/>
|
|
408
458
|
Purpose: **Deepgram Speech-to-Text conversion**<br/>
|
|
409
459
|
Example: `deepgram(language: "de")`<br/>
|
|
410
460
|
Notice: this node requires an API key!
|
|
411
461
|
|
|
462
|
+
> This node performs Speech-to-Text (S2T) conversion, i.e., it
|
|
463
|
+
> recognizes speech in the input audio stream and outputs a
|
|
464
|
+
> corresponding text stream.
|
|
465
|
+
|
|
412
466
|
| Port | Payload |
|
|
413
467
|
| ------- | ----------- |
|
|
414
468
|
| input | audio |
|
|
@@ -422,13 +476,17 @@ First a short overview of the available processing nodes:
|
|
|
422
476
|
| **version** | 1 | "latest" | *none* |
|
|
423
477
|
| **language** | 2 | "multi" | *none* |
|
|
424
478
|
|
|
425
|
-
### Text-to-Text Nodes
|
|
479
|
+
### Text-to-Text Nodes
|
|
480
|
+
|
|
481
|
+
The following nodes process text chunks only.
|
|
426
482
|
|
|
427
483
|
- Node: **deepl**<br/>
|
|
428
484
|
Purpose: **DeepL Text-to-Text translation**<br/>
|
|
429
485
|
Example: `deepl(src: "de", dst: "en")`<br/>
|
|
430
486
|
Notice: this node requires an API key!
|
|
431
487
|
|
|
488
|
+
> This node performs translation between English and German languages.
|
|
489
|
+
|
|
432
490
|
| Port | Payload |
|
|
433
491
|
| ------- | ----------- |
|
|
434
492
|
| input | text |
|
|
@@ -445,6 +503,12 @@ First a short overview of the available processing nodes:
|
|
|
445
503
|
Example: `openai(src: "de", dst: "en")`<br/>
|
|
446
504
|
Notice: this node requires an OpenAI API key!
|
|
447
505
|
|
|
506
|
+
> This node performs translation between English and German languages
|
|
507
|
+
> in the text stream or (if the source and destination language is
|
|
508
|
+
> the same) spellchecking of English or German languages in the text
|
|
509
|
+
> stream. It is based on the remote OpenAI cloud AI service and uses
|
|
510
|
+
> the GPT-4o-mini LLM.
|
|
511
|
+
|
|
448
512
|
| Port | Payload |
|
|
449
513
|
| ------- | ----------- |
|
|
450
514
|
| input | text |
|
|
@@ -461,7 +525,13 @@ First a short overview of the available processing nodes:
|
|
|
461
525
|
- Node: **ollama**<br/>
|
|
462
526
|
Purpose: **Ollama/Gemma Text-to-Text translation and spelling correction**<br/>
|
|
463
527
|
Example: `ollama(src: "de", dst: "en")`<br/>
|
|
464
|
-
Notice: this node requires
|
|
528
|
+
Notice: this node requires Ollama to be installed!
|
|
529
|
+
|
|
530
|
+
> This node performs translation between English and German languages
|
|
531
|
+
> in the text stream or (if the source and destination language is
|
|
532
|
+
> the same) spellchecking of English or German languages in the text
|
|
533
|
+
> stream. It is based on the local Ollama AI service and uses the
|
|
534
|
+
> Google Gemma 3 LLM.
|
|
465
535
|
|
|
466
536
|
| Port | Payload |
|
|
467
537
|
| ------- | ----------- |
|
|
@@ -479,6 +549,9 @@ First a short overview of the available processing nodes:
|
|
|
479
549
|
Purpose: **Transformers Text-to-Text translation**<br/>
|
|
480
550
|
Example: `transformers(src: "de", dst: "en")`<br/>
|
|
481
551
|
|
|
552
|
+
> This node performs translation between English and German languages
|
|
553
|
+
> in the text stream. It is based on local OPUS or SmolLM3 LLMs.
|
|
554
|
+
|
|
482
555
|
| Port | Payload |
|
|
483
556
|
| ------- | ----------- |
|
|
484
557
|
| input | text |
|
|
@@ -486,14 +559,34 @@ First a short overview of the available processing nodes:
|
|
|
486
559
|
|
|
487
560
|
| Parameter | Position | Default | Requirement |
|
|
488
561
|
| ------------ | --------- | -------- | ---------------- |
|
|
489
|
-
| **model** | *none* | "OPUS" | `/^(?:OPUS
|
|
562
|
+
| **model** | *none* | "OPUS" | `/^(?:OPUS\|SmolLM3)$/` |
|
|
490
563
|
| **src** | 0 | "de" | `/^(?:de\|en)$/` |
|
|
491
564
|
| **dst** | 1 | "en" | `/^(?:de\|en)$/` |
|
|
492
565
|
|
|
566
|
+
- Node: **sentence**<br/>
|
|
567
|
+
Purpose: **sentence splitting/merging**<br/>
|
|
568
|
+
Example: `sentence()`<br/>
|
|
569
|
+
|
|
570
|
+
> This node allows you to ensure that a text stream is split or merged
|
|
571
|
+
> into complete sentences. It is primarily intended to be used after
|
|
572
|
+
> the "deepgram" node and before "deepl" or "elevenlabs" nodes in
|
|
573
|
+
> order to improve overall quality.
|
|
574
|
+
|
|
575
|
+
| Port | Payload |
|
|
576
|
+
| ------- | ----------- |
|
|
577
|
+
| input | text |
|
|
578
|
+
| output | text |
|
|
579
|
+
|
|
580
|
+
| Parameter | Position | Default | Requirement |
|
|
581
|
+
| ------------ | --------- | -------- | ------------------ |
|
|
582
|
+
|
|
493
583
|
- Node: **subtitle**<br/>
|
|
494
584
|
Purpose: **SRT/VTT Subtitle Generation**<br/>
|
|
495
585
|
Example: `subtitle(format: "srt")`<br/>
|
|
496
586
|
|
|
587
|
+
> This node generates subtitles from the text stream (and its embedded
|
|
588
|
+
> timestamps) in the formats SRT (SubRip) or VTT (WebVTT).
|
|
589
|
+
|
|
497
590
|
| Port | Payload |
|
|
498
591
|
| ------- | ----------- |
|
|
499
592
|
| input | text |
|
|
@@ -502,11 +595,16 @@ First a short overview of the available processing nodes:
|
|
|
502
595
|
| Parameter | Position | Default | Requirement |
|
|
503
596
|
| ------------ | --------- | -------- | ------------------ |
|
|
504
597
|
| **format** | *none* | "srt" | /^(?:srt\|vtt)$/ |
|
|
598
|
+
| **words** | *none* | false | *none* |
|
|
505
599
|
|
|
506
600
|
- Node: **format**<br/>
|
|
507
601
|
Purpose: **text paragraph formatting**<br/>
|
|
508
602
|
Example: `format(width: 80)`<br/>
|
|
509
603
|
|
|
604
|
+
> This node formats the text stream into lines no longer than a
|
|
605
|
+
> certain width. It is primarily intended for use before writing text
|
|
606
|
+
> chunks to files.
|
|
607
|
+
|
|
510
608
|
| Port | Payload |
|
|
511
609
|
| ------- | ----------- |
|
|
512
610
|
| input | text |
|
|
@@ -516,29 +614,43 @@ First a short overview of the available processing nodes:
|
|
|
516
614
|
| ------------ | --------- | -------- | --------------------- |
|
|
517
615
|
| **width** | 0 | 80 | *none* |
|
|
518
616
|
|
|
519
|
-
### Text-to-Audio Nodes
|
|
617
|
+
### Text-to-Audio Nodes
|
|
618
|
+
|
|
619
|
+
The following nodes convert text chunks to audio chunks.
|
|
520
620
|
|
|
521
621
|
- Node: **elevenlabs**<br/>
|
|
522
622
|
Purpose: **ElevenLabs Text-to-Speech conversion**<br/>
|
|
523
623
|
Example: `elevenlabs(language: "en")`<br/>
|
|
524
|
-
Notice: this node requires an API key!
|
|
624
|
+
Notice: this node requires an ElevenLabs API key!
|
|
625
|
+
|
|
626
|
+
> This node perform Text-to-Speech (T2S) conversion, i.e., it converts
|
|
627
|
+
> the input text stream into an output audio stream. It is intended to
|
|
628
|
+
> generate speech.
|
|
525
629
|
|
|
526
630
|
| Port | Payload |
|
|
527
631
|
| ------- | ----------- |
|
|
528
632
|
| input | text |
|
|
529
633
|
| output | audio |
|
|
530
634
|
|
|
531
|
-
| Parameter
|
|
532
|
-
|
|
|
533
|
-
| **key**
|
|
534
|
-
| **voice**
|
|
535
|
-
| **language**
|
|
635
|
+
| Parameter | Position | Default | Requirement |
|
|
636
|
+
| -------------- | --------- | --------- | ------------------ |
|
|
637
|
+
| **key** | *none* | env.SPEECHFLOW\_ELEVENLABS\_KEY | *none* |
|
|
638
|
+
| **voice** | 0 | "Brian" | `/^(?:Brittney\|Cassidy\|Leonie\|Mark\|Brian)$/` |
|
|
639
|
+
| **language** | 1 | "de" | `/^(?:de\|en)$/` |
|
|
640
|
+
| **speed** | 2 | 1.00 | `n >= 0`7 && n <= 1.2` |
|
|
641
|
+
| **stability** | 3 | 0.5 | `n >= 0.0 && n <= 1.0` |
|
|
642
|
+
| **similarity** | 4 | 0.75 | `n >= 0.0 && n <= 1.0` |
|
|
643
|
+
| **optimize** | 5 | "latency" | `/^(?:latency\|quality)$/` |
|
|
536
644
|
|
|
537
645
|
- Node: **kokoro**<br/>
|
|
538
646
|
Purpose: **Kokoro Text-to-Speech conversion**<br/>
|
|
539
647
|
Example: `kokoro(language: "en")`<br/>
|
|
540
648
|
Notice: this currently support English language only!
|
|
541
649
|
|
|
650
|
+
> This node perform Text-to-Speech (T2S) conversion, i.e., it converts
|
|
651
|
+
> the input text stream into an output audio stream. It is intended to
|
|
652
|
+
> generate speech.
|
|
653
|
+
|
|
542
654
|
| Port | Payload |
|
|
543
655
|
| ------- | ----------- |
|
|
544
656
|
| input | text |
|
|
@@ -546,16 +658,23 @@ First a short overview of the available processing nodes:
|
|
|
546
658
|
|
|
547
659
|
| Parameter | Position | Default | Requirement |
|
|
548
660
|
| ------------ | --------- | -------- | ----------- |
|
|
549
|
-
| **voice** | 0 | "Aoede" | `/^(?:Aoede
|
|
661
|
+
| **voice** | 0 | "Aoede" | `/^(?:Aoede\|Heart\|Puck\|Fenrir)$/` |
|
|
550
662
|
| **language** | 1 | "en" | `/^en$/` |
|
|
551
663
|
| **speed** | 2 | 1.25 | 1.0...1.30 |
|
|
552
664
|
|
|
553
|
-
### Any-to-Any Nodes
|
|
665
|
+
### Any-to-Any Nodes
|
|
666
|
+
|
|
667
|
+
The following nodes process any type of chunk, i.e., both audio and text chunks.
|
|
554
668
|
|
|
555
669
|
- Node: **filter**<br/>
|
|
556
670
|
Purpose: **meta information based filter**<br/>
|
|
557
671
|
Example: `filter(type: "audio", var: "meta:gender", op: "==", val: "male")`<br/>
|
|
558
672
|
|
|
673
|
+
> This node allows you to filter nodes based on certain criteria. It
|
|
674
|
+
> is primarily intended to be used in conjunction with the "gender"
|
|
675
|
+
> node and in front of the `elevenlabs` or `kokoro` nodes in order to
|
|
676
|
+
> translate with a corresponding voice.
|
|
677
|
+
|
|
559
678
|
| Port | Payload |
|
|
560
679
|
| ------- | ----------- |
|
|
561
680
|
| input | text, audio |
|
|
@@ -565,14 +684,18 @@ First a short overview of the available processing nodes:
|
|
|
565
684
|
| ------------ | --------- | -------- | --------------------- |
|
|
566
685
|
| **type** | 0 | "audio" | `/^(?:audio\|text)$/` |
|
|
567
686
|
| **name** | 1 | "filter" | `/^.+$/` |
|
|
568
|
-
| **var** | 2 | "" | `/^(?:meta
|
|
569
|
-
| **op** | 3 | "==" | `/^(
|
|
687
|
+
| **var** | 2 | "" | `/^(?:meta:.+\|payload:(?:length\|text)\|time:(?:start\|end))$/` |
|
|
688
|
+
| **op** | 3 | "==" | `/^(?:<\|<=\|==\|!=\|~~\|!~\|>=\|>)$/` |
|
|
570
689
|
| **val** | 4 | "" | `/^.*$/` |
|
|
571
690
|
|
|
572
691
|
- Node: **trace**<br/>
|
|
573
692
|
Purpose: **data flow tracing**<br/>
|
|
574
693
|
Example: `trace(type: "audio")`<br/>
|
|
575
694
|
|
|
695
|
+
> This node allows you to trace the audio and text chunk flow through
|
|
696
|
+
> the **SpeechFlow** graph. It just passes through its chunks, but
|
|
697
|
+
> sends information about the chunks to the log.
|
|
698
|
+
|
|
576
699
|
| Port | Payload |
|
|
577
700
|
| ------- | ----------- |
|
|
578
701
|
| input | text, audio |
|
|
@@ -583,10 +706,45 @@ First a short overview of the available processing nodes:
|
|
|
583
706
|
| **type** | 0 | "audio" | `/^(?:audio\|text)$/` |
|
|
584
707
|
| **name** | 1 | *none* | *none* |
|
|
585
708
|
|
|
709
|
+
REST/WebSocket API
|
|
710
|
+
------------------
|
|
711
|
+
|
|
712
|
+
**SpeechFlow** has an externally exposed REST/WebSockets API which can
|
|
713
|
+
be used to control the nodes and to receive information from nodes.
|
|
714
|
+
For controlling a node you have three possibilities (illustrated by
|
|
715
|
+
controlling the mode of the "mute" node):
|
|
716
|
+
|
|
717
|
+
```sh
|
|
718
|
+
# use HTTP/REST/GET:
|
|
719
|
+
$ curl http://127.0.0.1:8484/api/COMMAND/mute/mode/silenced
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
```sh
|
|
723
|
+
# use HTTP/REST/POST:
|
|
724
|
+
$ curl -H "Content-type: application/json" \
|
|
725
|
+
--data '{ "request": "COMMAND", "node": "mute", "args": [ "mode", "silenced" ] }' \
|
|
726
|
+
http://127.0.0.1:8484/api
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
```sh
|
|
730
|
+
# use WebSockets:
|
|
731
|
+
$ wscat -c ws://127.0.0.1:8484/api \
|
|
732
|
+
> { "request": "COMMAND", "node": "mute", "args": [ "mode", "silenced" ] }
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
For receiving emitted information from nodes, you have to use the WebSockets
|
|
736
|
+
API (illustrated by the emitted information of the "meter" node):
|
|
737
|
+
|
|
738
|
+
```sh
|
|
739
|
+
# use WebSockets:
|
|
740
|
+
$ wscat -c ws://127.0.0.1:8484/api \
|
|
741
|
+
< { "response": "NOTIFY", "node": "meter", "args": [ "meter", "LUFS-S", -35.75127410888672 ] }
|
|
742
|
+
```
|
|
743
|
+
|
|
586
744
|
History
|
|
587
745
|
-------
|
|
588
746
|
|
|
589
|
-
**
|
|
747
|
+
**SpeechFlow**, as a technical cut-through, was initially created in
|
|
590
748
|
March 2024 for use in the msg Filmstudio context. It was later refined
|
|
591
749
|
into a more complete toolkit in April 2025 and this way the first time
|
|
592
750
|
could be used in production. It was fully refactored in July 2025 in
|
|
@@ -61,6 +61,7 @@ class SpeechFlowNodeGender extends speechflow_node_1.default {
|
|
|
61
61
|
queueRecv = this.queue.pointerUse("recv");
|
|
62
62
|
queueAC = this.queue.pointerUse("ac");
|
|
63
63
|
queueSend = this.queue.pointerUse("send");
|
|
64
|
+
shutdown = false;
|
|
64
65
|
/* construct node */
|
|
65
66
|
constructor(id, cfg, opts, args) {
|
|
66
67
|
super(id, cfg, opts, args);
|
|
@@ -133,7 +134,7 @@ class SpeechFlowNodeGender extends speechflow_node_1.default {
|
|
|
133
134
|
let workingOff = false;
|
|
134
135
|
const workOffQueue = async () => {
|
|
135
136
|
/* control working off round */
|
|
136
|
-
if (workingOff)
|
|
137
|
+
if (workingOff || this.shutdown)
|
|
137
138
|
return;
|
|
138
139
|
workingOff = true;
|
|
139
140
|
if (workingOffTimer !== null) {
|
|
@@ -215,6 +216,8 @@ class SpeechFlowNodeGender extends speechflow_node_1.default {
|
|
|
215
216
|
read(_size) {
|
|
216
217
|
/* flush pending audio chunks */
|
|
217
218
|
const flushPendingChunks = () => {
|
|
219
|
+
if (self.shutdown)
|
|
220
|
+
return;
|
|
218
221
|
const element = self.queueSend.peek();
|
|
219
222
|
if (element !== undefined
|
|
220
223
|
&& element.type === "audio-eof")
|
|
@@ -234,7 +237,7 @@ class SpeechFlowNodeGender extends speechflow_node_1.default {
|
|
|
234
237
|
&& element.gender === undefined)
|
|
235
238
|
break;
|
|
236
239
|
const duration = utils.audioArrayDuration(element.data);
|
|
237
|
-
log("
|
|
240
|
+
log("debug", `send chunk (${duration.toFixed(3)}s) with gender <${element.gender}>`);
|
|
238
241
|
element.chunk.meta.set("gender", element.gender);
|
|
239
242
|
this.push(element.chunk);
|
|
240
243
|
self.queueSend.walk(+1);
|
|
@@ -250,6 +253,8 @@ class SpeechFlowNodeGender extends speechflow_node_1.default {
|
|
|
250
253
|
}
|
|
251
254
|
/* close node */
|
|
252
255
|
async close() {
|
|
256
|
+
/* indicate shutdown */
|
|
257
|
+
this.shutdown = true;
|
|
253
258
|
/* close stream */
|
|
254
259
|
if (this.stream !== null) {
|
|
255
260
|
this.stream.destroy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechflow-node-a2a-gender.js","sourceRoot":"","sources":["../src/speechflow-node-a2a-gender.ts"],"names":[],"mappings":";AAAA;;;;EAIE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,6BAA6B;AAC7B,0DAA0C;AAC1C,8DAA4C;AAE5C,6BAA6B;AAC7B,wEAA0D;AAC1D,uCAAyC;AAEzC,6BAA6B;AAC7B,wEAAmE;AACnE,0DAAoE;AAYpE,8CAA8C;AAC9C,MAAqB,oBAAqB,SAAQ,yBAAc;IAC5D,kCAAkC;IAC3B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAA;IAE7B,sBAAsB;IACd,MAAM,CAAC,gBAAgB,GAAG,KAAK,CAAA;IAC/B,UAAU,GAAoD,IAAI,CAAA;IAClE,KAAK,GAAO,IAAI,KAAK,CAAC,KAAK,EAAqB,CAAA;IAChD,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACzC,OAAO,GAAK,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IACvC,S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L,CAAC;;AA/OL,uCAgPC"}
|
|
@@ -59,7 +59,8 @@ class SpeechFlowNodeMeter extends speechflow_node_1.default {
|
|
|
59
59
|
super(id, cfg, opts, args);
|
|
60
60
|
/* declare node configuration parameters */
|
|
61
61
|
this.configure({
|
|
62
|
-
interval: { type: "number", pos: 0, val: 250 }
|
|
62
|
+
interval: { type: "number", pos: 0, val: 250 },
|
|
63
|
+
dashboard: { type: "string", val: "" }
|
|
63
64
|
});
|
|
64
65
|
/* declare node input/output format */
|
|
65
66
|
this.input = "audio";
|
|
@@ -79,9 +80,11 @@ class SpeechFlowNodeMeter extends speechflow_node_1.default {
|
|
|
79
80
|
let rms = 0;
|
|
80
81
|
/* setup loudness emitting interval */
|
|
81
82
|
this.interval = setInterval(() => {
|
|
82
|
-
this.log("
|
|
83
|
+
this.log("debug", `LUFS-S: ${lufss.toFixed(1)} dB, RMS: ${rms.toFixed(1)} dB`);
|
|
83
84
|
this.sendResponse(["meter", "LUFS-S", lufss]);
|
|
84
85
|
this.sendResponse(["meter", "RMS", rms]);
|
|
86
|
+
if (this.params.dashboard !== "")
|
|
87
|
+
this.dashboardInfo("audio", this.params.dashboard, "final", lufss);
|
|
85
88
|
}, this.params.interval);
|
|
86
89
|
/* provide Duplex stream and internally attach to VAD */
|
|
87
90
|
const self = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechflow-node-a2a-meter.js","sourceRoot":"","sources":["../src/speechflow-node-a2a-meter.ts"],"names":[],"mappings":";AAAA;;;;EAIE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,6BAA6B;AAC7B,8DAAgC;AAEhC,6BAA6B;AAC7B,iDAA0D;AAE1D,6BAA6B;AAC7B,wEAAmE;AACnE,0DAAoE;AAEpE,0CAA0C;AAC1C,MAAqB,mBAAoB,SAAQ,yBAAc;IAC3D,kCAAkC;IAC3B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAA;IAE5B,sBAAsB;IACtB,Q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