speechflow 1.4.2 → 1.4.4
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 +19 -0
- package/etc/stx.conf +17 -11
- package/package.json +7 -4
- package/speechflow-cli/dst/speechflow-node-a2a-ffmpeg.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-a2a-ffmpeg.js +153 -0
- package/speechflow-cli/dst/speechflow-node-a2a-ffmpeg.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-a2a-gender.d.ts +20 -0
- package/speechflow-cli/dst/speechflow-node-a2a-gender.js +349 -0
- package/speechflow-cli/dst/speechflow-node-a2a-gender.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-a2a-meter.d.ts +16 -0
- package/speechflow-cli/dst/speechflow-node-a2a-meter.js +232 -0
- package/speechflow-cli/dst/speechflow-node-a2a-meter.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-a2a-mute.d.ts +17 -0
- package/speechflow-cli/dst/speechflow-node-a2a-mute.js +117 -0
- package/speechflow-cli/dst/speechflow-node-a2a-mute.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-a2a-vad.d.ts +19 -0
- package/speechflow-cli/dst/speechflow-node-a2a-vad.js +374 -0
- package/speechflow-cli/dst/speechflow-node-a2a-vad.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-a2a-wav.d.ts +11 -0
- package/speechflow-cli/dst/speechflow-node-a2a-wav.js +211 -0
- package/speechflow-cli/dst/speechflow-node-a2a-wav.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-a2t-deepgram.d.ts +19 -0
- package/speechflow-cli/dst/speechflow-node-a2t-deepgram.js +328 -0
- package/speechflow-cli/dst/speechflow-node-a2t-deepgram.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.d.ts +18 -0
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js +238 -0
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2a-kokoro.d.ts +14 -0
- package/speechflow-cli/dst/speechflow-node-t2a-kokoro.js +155 -0
- package/speechflow-cli/dst/speechflow-node-t2a-kokoro.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-deepl.d.ts +15 -0
- package/speechflow-cli/dst/speechflow-node-t2t-deepl.js +146 -0
- package/speechflow-cli/dst/speechflow-node-t2t-deepl.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-format.d.ts +11 -0
- package/speechflow-cli/dst/speechflow-node-t2t-format.js +82 -0
- package/speechflow-cli/dst/speechflow-node-t2t-format.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-ollama.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-t2t-ollama.js +247 -0
- package/speechflow-cli/dst/speechflow-node-t2t-ollama.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-openai.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-t2t-openai.js +227 -0
- package/speechflow-cli/dst/speechflow-node-t2t-openai.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-sentence.d.ts +17 -0
- package/speechflow-cli/dst/speechflow-node-t2t-sentence.js +250 -0
- package/speechflow-cli/dst/speechflow-node-t2t-sentence.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-subtitle.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-t2t-subtitle.js +278 -0
- package/speechflow-cli/dst/speechflow-node-t2t-subtitle.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-t2t-transformers.d.ts +14 -0
- package/speechflow-cli/dst/speechflow-node-t2t-transformers.js +265 -0
- package/speechflow-cli/dst/speechflow-node-t2t-transformers.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-x2x-filter.d.ts +11 -0
- package/speechflow-cli/dst/speechflow-node-x2x-filter.js +121 -0
- package/speechflow-cli/dst/speechflow-node-x2x-filter.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-x2x-trace.d.ts +11 -0
- package/speechflow-cli/dst/speechflow-node-x2x-trace.js +111 -0
- package/speechflow-cli/dst/speechflow-node-x2x-trace.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-xio-device.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-xio-device.js +230 -0
- package/speechflow-cli/dst/speechflow-node-xio-device.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-xio-file.d.ts +11 -0
- package/speechflow-cli/dst/speechflow-node-xio-file.js +216 -0
- package/speechflow-cli/dst/speechflow-node-xio-file.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-xio-mqtt.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-xio-mqtt.js +188 -0
- package/speechflow-cli/dst/speechflow-node-xio-mqtt.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node-xio-websocket.d.ts +13 -0
- package/speechflow-cli/dst/speechflow-node-xio-websocket.js +278 -0
- package/speechflow-cli/dst/speechflow-node-xio-websocket.js.map +1 -0
- package/speechflow-cli/dst/speechflow-node.d.ts +65 -0
- package/speechflow-cli/dst/speechflow-node.js +180 -0
- package/speechflow-cli/dst/speechflow-node.js.map +1 -0
- package/speechflow-cli/dst/speechflow-utils.d.ts +74 -0
- package/speechflow-cli/dst/speechflow-utils.js +519 -0
- package/speechflow-cli/dst/speechflow-utils.js.map +1 -0
- package/speechflow-cli/dst/speechflow.d.ts +7 -0
- package/speechflow-cli/dst/speechflow.js +837 -0
- package/speechflow-cli/dst/speechflow.js.map +1 -0
- package/speechflow-cli/etc/stx.conf +13 -13
- package/speechflow-cli/package.json +7 -7
- package/speechflow-cli/src/speechflow.ts +5 -5
- package/speechflow-ui-db/dst/app-font-TypoPRO-SourceSansPro-Bold.eot +0 -0
- package/speechflow-ui-db/dst/app-font-TypoPRO-SourceSansPro-Bold.ttf +0 -0
- package/speechflow-ui-db/dst/app-font-TypoPRO-SourceSansPro-Bold.woff +0 -0
- package/speechflow-ui-db/dst/app-font-TypoPRO-SourceSansPro-Regular.eot +0 -0
- package/speechflow-ui-db/dst/app-font-TypoPRO-SourceSansPro-Regular.ttf +0 -0
- package/speechflow-ui-db/dst/app-font-TypoPRO-SourceSansPro-Regular.woff +0 -0
- package/speechflow-ui-db/dst/app-font-fa-brands-400.woff2 +0 -0
- package/speechflow-ui-db/dst/app-font-fa-regular-400.woff2 +0 -0
- package/speechflow-ui-db/dst/app-font-fa-solid-900.woff2 +0 -0
- package/speechflow-ui-db/dst/app-font-fa-v4compatibility.woff2 +0 -0
- package/speechflow-ui-db/dst/app-icon.svg +26 -0
- package/speechflow-ui-db/dst/index.css +5 -0
- package/speechflow-ui-db/dst/index.html +24 -0
- package/speechflow-ui-db/dst/index.js +616 -0
- package/speechflow-ui-db/etc/stx.conf +17 -17
- package/speechflow-ui-db/package.json +2 -2
- package/speechflow-ui-db/src/app.vue +14 -7
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Bold.eot +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Bold.ttf +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Bold.woff +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Regular.eot +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Regular.ttf +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Regular.woff +0 -0
- package/speechflow-ui-st/dst/app-font-fa-brands-400.woff2 +0 -0
- package/speechflow-ui-st/dst/app-font-fa-regular-400.woff2 +0 -0
- package/speechflow-ui-st/dst/app-font-fa-solid-900.woff2 +0 -0
- package/speechflow-ui-st/dst/app-font-fa-v4compatibility.woff2 +0 -0
- package/speechflow-ui-st/dst/app-icon.svg +26 -0
- package/speechflow-ui-st/dst/index.css +5 -0
- package/speechflow-ui-st/dst/index.html +24 -0
- package/speechflow-ui-st/dst/index.js +610 -0
- package/speechflow-ui-st/etc/stx.conf +17 -17
- package/speechflow-ui-st/package.json +2 -2
- /package/{speechflow-cli/etc → etc}/speechflow.yaml +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
ChangeLog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
1.4.4 (2025-08-07)
|
|
6
|
+
------------------
|
|
7
|
+
|
|
8
|
+
- BUGFIX: do not ignore "dst" files in NPM distribution
|
|
9
|
+
- UPGRADE: upgrade NPM dependencies
|
|
10
|
+
|
|
11
|
+
1.4.3 (2025-08-06)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
- IMPROVEMENT: better fatal error handling in main program
|
|
15
|
+
- IMPROVEMENT: better optical appearance of dashboard
|
|
16
|
+
- IMPROVEMENT: better reporting of STX build CWD
|
|
17
|
+
- UPGRADE: upgrade NPM dependencies
|
|
18
|
+
|
|
19
|
+
1.4.2 (2025-08-05)
|
|
20
|
+
------------------
|
|
21
|
+
|
|
22
|
+
- CLEANUP: various code cleanups
|
|
23
|
+
|
|
5
24
|
1.4.1 (2025-08-05)
|
|
6
25
|
------------------
|
|
7
26
|
|
package/etc/stx.conf
CHANGED
|
@@ -4,38 +4,38 @@
|
|
|
4
4
|
## Licensed under GPL 3.0 <https://spdx.org/licenses/GPL-3.0-only>
|
|
5
5
|
##
|
|
6
6
|
|
|
7
|
-
# (internal): just pass-through "npm install" operation
|
|
7
|
+
# [top-level] (internal): just pass-through "npm install" operation
|
|
8
8
|
post-install
|
|
9
9
|
npm --prefix speechflow-cli install && \
|
|
10
10
|
npm --prefix speechflow-ui-db install && \
|
|
11
11
|
npm --prefix speechflow-ui-st install
|
|
12
12
|
|
|
13
|
-
# automatically update all NPM dependencies
|
|
13
|
+
# [top-level] automatically update all NPM dependencies
|
|
14
14
|
upd
|
|
15
15
|
npx -y upd && \
|
|
16
16
|
(cd speechflow-cli && npx -y upd) && \
|
|
17
17
|
(cd speechflow-ui-db && npx -y upd) && \
|
|
18
18
|
(cd speechflow-ui-st && npx -y upd)
|
|
19
19
|
|
|
20
|
-
# lint components for development
|
|
20
|
+
# [top-level] lint components for development
|
|
21
21
|
lint
|
|
22
22
|
npm --prefix speechflow-cli start lint && \
|
|
23
23
|
npm --prefix speechflow-ui-db start lint && \
|
|
24
24
|
npm --prefix speechflow-ui-st start lint
|
|
25
25
|
|
|
26
|
-
# build components for production (full build)
|
|
26
|
+
# [top-level] build components for production (full build)
|
|
27
27
|
build
|
|
28
28
|
npm --prefix speechflow-cli start build && \
|
|
29
29
|
npm --prefix speechflow-ui-db start build && \
|
|
30
30
|
npm --prefix speechflow-ui-st start build
|
|
31
31
|
|
|
32
|
-
# (internal)
|
|
32
|
+
# [top-level] (internal) build components for development (partial build only)
|
|
33
33
|
build:dev
|
|
34
34
|
npm --prefix speechflow-cli start build && \
|
|
35
35
|
npm --prefix speechflow-ui-db start build && \
|
|
36
36
|
npm --prefix speechflow-ui-st start build
|
|
37
37
|
|
|
38
|
-
# (internal)
|
|
38
|
+
# [top-level] (internal) build components for development (continuous file watching)
|
|
39
39
|
build:dev:watch
|
|
40
40
|
watch "npm start build:dev" \
|
|
41
41
|
speechflow-cli/src \
|
|
@@ -43,27 +43,33 @@ build:dev:watch
|
|
|
43
43
|
speechflow-ui-st/src \
|
|
44
44
|
--wait=2 --interval=1
|
|
45
45
|
|
|
46
|
-
# (internal)
|
|
46
|
+
# [top-level] (internal) run command-line interface for production
|
|
47
47
|
run:dev:watch
|
|
48
48
|
wait-on -l "speechflow-cli/dst/speechflow.js" && \
|
|
49
49
|
cross-env NODE_OPTIONS="--no-warnings" \
|
|
50
|
-
nodemon --signal SIGINT -w speechflow-
|
|
50
|
+
nodemon --signal SIGINT -w speechflow-cli/dst --delay 1500ms \
|
|
51
51
|
speechflow-cli/dst/speechflow.js -- \
|
|
52
52
|
$SPEECHFLOW_OPTIONS
|
|
53
53
|
|
|
54
|
-
# (internal)
|
|
54
|
+
# [top-level] (internal) run command-line interface for development (continuous file watching)
|
|
55
55
|
run:dev
|
|
56
56
|
concurrently -p "[{name}]" -n "build,run" -c "blue,red" \
|
|
57
57
|
"npm start build:dev:watch" \
|
|
58
58
|
"npm start run:dev:watch"
|
|
59
59
|
|
|
60
|
-
#
|
|
60
|
+
# [top-level] test drive
|
|
61
|
+
test
|
|
62
|
+
node --enable-source-maps speechflow-cli/dst/speechflow.js \
|
|
63
|
+
-v info -c test@etc/speechflow.yaml \
|
|
64
|
+
-d audio:meter1:DE,text:text1:DE-Interim,text:text2:DE-Final,text:text3:EN,audio:meter2:EN
|
|
65
|
+
|
|
66
|
+
# [top-level] remove all generated artifacts (reverse of "npm start build")
|
|
61
67
|
clean
|
|
62
68
|
npm --prefix speechflow-cli start clean && \
|
|
63
69
|
npm --prefix speechflow-ui-db start clean && \
|
|
64
70
|
npm --prefix speechflow-ui-st start clean
|
|
65
71
|
|
|
66
|
-
# remove all generated artifacts (reverse of "npm install" and "npm start build")
|
|
72
|
+
# [top-level] remove all generated artifacts (reverse of "npm install" and "npm start build")
|
|
67
73
|
clean:dist
|
|
68
74
|
npm --prefix speechflow-cli start clean:dist && \
|
|
69
75
|
npm --prefix speechflow-ui-db start clean:dist && \
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "speechflow",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"x-stdver": "1.4.
|
|
5
|
-
"x-release": "2025-08-
|
|
3
|
+
"version": "1.4.4",
|
|
4
|
+
"x-stdver": "1.4.4-GA",
|
|
5
|
+
"x-release": "2025-08-07",
|
|
6
6
|
"homepage": "https://github.com/rse/speechflow",
|
|
7
7
|
"description": "Speech Processing Flow Graph",
|
|
8
8
|
"license": "GPL-3.0-only",
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "git+https://github.com/rse/speechflow.git"
|
|
17
17
|
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@rse/stx": "1.0.7"
|
|
20
|
+
},
|
|
18
21
|
"devDependencies": {
|
|
19
|
-
"@rse/stx": "1.0.7",
|
|
20
22
|
"nodemon": "3.1.10",
|
|
21
23
|
"watch": "1.0.2",
|
|
22
24
|
"concurrently": "9.2.0",
|
|
@@ -41,6 +43,7 @@
|
|
|
41
43
|
"scripts": {
|
|
42
44
|
"postinstall": "npm start post-install",
|
|
43
45
|
"start": "stx -v4 -c etc/stx.conf",
|
|
46
|
+
"test": "stx -v4 -c etc/stx.conf test",
|
|
44
47
|
"speechflow": "node --no-warnings speechflow-cli/dst/speechflow.js"
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import SpeechFlowNode from "./speechflow-node";
|
|
2
|
+
export default class SpeechFlowNodeFFmpeg extends SpeechFlowNode {
|
|
3
|
+
static name: string;
|
|
4
|
+
private ffmpegBinary;
|
|
5
|
+
private ffmpeg;
|
|
6
|
+
constructor(id: string, cfg: {
|
|
7
|
+
[id: string]: any;
|
|
8
|
+
}, opts: {
|
|
9
|
+
[id: string]: any;
|
|
10
|
+
}, args: any[]);
|
|
11
|
+
open(): Promise<void>;
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
** SpeechFlow - Speech Processing Flow Graph
|
|
4
|
+
** Copyright (c) 2024-2025 Dr. Ralf S. Engelschall <rse@engelschall.com>
|
|
5
|
+
** Licensed under GPL 3.0 <https://spdx.org/licenses/GPL-3.0-only>
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
/* standard dependencies */
|
|
45
|
+
const node_stream_1 = __importDefault(require("node:stream"));
|
|
46
|
+
/* external dependencies */
|
|
47
|
+
const ffmpeg_1 = __importDefault(require("@rse/ffmpeg"));
|
|
48
|
+
const ffmpeg_stream_1 = require("ffmpeg-stream");
|
|
49
|
+
/* internal dependencies */
|
|
50
|
+
const speechflow_node_1 = __importDefault(require("./speechflow-node"));
|
|
51
|
+
const utils = __importStar(require("./speechflow-utils"));
|
|
52
|
+
/* SpeechFlow node for FFmpeg */
|
|
53
|
+
class SpeechFlowNodeFFmpeg extends speechflow_node_1.default {
|
|
54
|
+
/* declare official node name */
|
|
55
|
+
static name = "ffmpeg";
|
|
56
|
+
/* internal state */
|
|
57
|
+
ffmpegBinary = ffmpeg_1.default.supported ? ffmpeg_1.default.binary : "ffmpeg";
|
|
58
|
+
ffmpeg = null;
|
|
59
|
+
/* construct node */
|
|
60
|
+
constructor(id, cfg, opts, args) {
|
|
61
|
+
super(id, cfg, opts, args);
|
|
62
|
+
/* declare node configuration parameters */
|
|
63
|
+
this.configure({
|
|
64
|
+
src: { type: "string", pos: 0, val: "pcm", match: /^(?:pcm|wav|mp3|opus)$/ },
|
|
65
|
+
dst: { type: "string", pos: 1, val: "wav", match: /^(?:pcm|wav|mp3|opus)$/ }
|
|
66
|
+
});
|
|
67
|
+
/* declare node input/output format */
|
|
68
|
+
this.input = "audio";
|
|
69
|
+
this.output = "audio";
|
|
70
|
+
}
|
|
71
|
+
/* open node */
|
|
72
|
+
async open() {
|
|
73
|
+
/* sanity check situation */
|
|
74
|
+
if (this.params.src === this.params.dst)
|
|
75
|
+
throw new Error("source and destination formats should not be the same");
|
|
76
|
+
/* instantiate FFmpeg sub-process */
|
|
77
|
+
this.ffmpeg = new ffmpeg_stream_1.Converter(this.ffmpegBinary);
|
|
78
|
+
const streamInput = this.ffmpeg.createInputStream({
|
|
79
|
+
/* FFmpeg input options */
|
|
80
|
+
"fflags": "nobuffer",
|
|
81
|
+
"flags": "low_delay",
|
|
82
|
+
"probesize": 32,
|
|
83
|
+
"analyzeduration": 0,
|
|
84
|
+
...(this.params.src === "pcm" ? {
|
|
85
|
+
"f": "s16le",
|
|
86
|
+
"ar": this.config.audioSampleRate,
|
|
87
|
+
"ac": this.config.audioChannels
|
|
88
|
+
} : {}),
|
|
89
|
+
...(this.params.src === "wav" ? {
|
|
90
|
+
"f": "wav"
|
|
91
|
+
} : {}),
|
|
92
|
+
...(this.params.src === "mp3" ? {
|
|
93
|
+
"f": "mp3"
|
|
94
|
+
} : {}),
|
|
95
|
+
...(this.params.src === "opus" ? {
|
|
96
|
+
"f": "opus"
|
|
97
|
+
} : {})
|
|
98
|
+
});
|
|
99
|
+
const streamOutput = this.ffmpeg.createOutputStream({
|
|
100
|
+
/* FFmpeg output options */
|
|
101
|
+
"flush_packets": 1,
|
|
102
|
+
...(this.params.dst === "pcm" ? {
|
|
103
|
+
"c:a": "pcm_s16le",
|
|
104
|
+
"ar": this.config.audioSampleRate,
|
|
105
|
+
"ac": this.config.audioChannels,
|
|
106
|
+
"f": "s16le",
|
|
107
|
+
} : {}),
|
|
108
|
+
...(this.params.dst === "wav" ? {
|
|
109
|
+
"f": "wav"
|
|
110
|
+
} : {}),
|
|
111
|
+
...(this.params.dst === "mp3" ? {
|
|
112
|
+
"c:a": "libmp3lame",
|
|
113
|
+
"b:a": "192k",
|
|
114
|
+
"f": "mp3"
|
|
115
|
+
} : {}),
|
|
116
|
+
...(this.params.dst === "opus" ? {
|
|
117
|
+
"acodec": "libopus",
|
|
118
|
+
"f": "opus"
|
|
119
|
+
} : {})
|
|
120
|
+
});
|
|
121
|
+
this.ffmpeg.run();
|
|
122
|
+
/* establish a duplex stream and connect it to FFmpeg */
|
|
123
|
+
this.stream = node_stream_1.default.Duplex.from({
|
|
124
|
+
writable: streamInput,
|
|
125
|
+
readable: streamOutput
|
|
126
|
+
});
|
|
127
|
+
/* wrap streams with conversions for chunk vs plain audio */
|
|
128
|
+
const wrapper1 = utils.createTransformStreamForWritableSide();
|
|
129
|
+
const wrapper2 = utils.createTransformStreamForReadableSide("audio", () => this.timeZero);
|
|
130
|
+
this.stream = node_stream_1.default.compose(wrapper1, this.stream, wrapper2);
|
|
131
|
+
}
|
|
132
|
+
/* close node */
|
|
133
|
+
async close() {
|
|
134
|
+
/* close duplex stream */
|
|
135
|
+
if (this.stream !== null) {
|
|
136
|
+
await new Promise((resolve) => {
|
|
137
|
+
if (this.stream instanceof node_stream_1.default.Duplex)
|
|
138
|
+
this.stream.end(() => { resolve(); });
|
|
139
|
+
else
|
|
140
|
+
resolve();
|
|
141
|
+
});
|
|
142
|
+
this.stream.destroy();
|
|
143
|
+
this.stream = null;
|
|
144
|
+
}
|
|
145
|
+
/* shutdown FFmpeg */
|
|
146
|
+
if (this.ffmpeg !== null) {
|
|
147
|
+
this.ffmpeg.kill();
|
|
148
|
+
this.ffmpeg = null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.default = SpeechFlowNodeFFmpeg;
|
|
153
|
+
//# sourceMappingURL=speechflow-node-a2a-ffmpeg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speechflow-node-a2a-ffmpeg.js","sourceRoot":"","sources":["../src/speechflow-node-a2a-ffmpeg.ts"],"names":[],"mappings":";AAAA;;;;EAIE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,6BAA6B;AAC7B,8DAAuD;AAEvD,6BAA6B;AAC7B,yDAAuD;AACvD,iDAAyD;AAEzD,6BAA6B;AAC7B,wEAA6D;AAC7D,0DAA8D;AAE9D,kCAAkC;AAClC,MAAqB,oBAAqB,SAAQ,yBAAc;IAC5D,kCAAkC;IAC3B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAA;IAE7B,sBAAsB;IACd,YAAY,GAAG,gBAAM,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC1D,MAAM,GAAwB,IAAI,CAAA;IAE1C,sBAAsB;IACtB,YAAa,EAAU,EAAE,GAA4B,EAAE,IAA6B,EAAE,IAAW;QAC7F,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QAE1B,6CAA6C;QAC7C,IAAI,CAAC,SAAS,CAAC;YACX,GAAG,EAAE,EAAE,IAAI,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AM,CAAC,MAAM,CAAC,IAAI,CAAC;YAC7B,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,YAAY;SACzB,CAAC,CAAA;QAEF,8DAA8D;QAC9D,MAAM,QAAQ,GAAG,KAAK,CAAC,oCAAoC,EAAE,CAAA;QAC7D,MAAM,QAAQ,GAAG,KAAK,CAAC,oCAAoC,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACzF,IAAI,CAAC,MAAM,GAAG,qBAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACjE,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,KAAK;QACP,2BAA2B;QAC3B,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBAChC,IAAI,IAAI,CAAC,MAAM,YAAY,qBAAM,CAAC,MAAM;oBACpC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;;oBAEpC,OAAO,EAAE,CAAA;YACjB,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;YACrB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QACtB,CAAC;QAED,uBAAuB;QACvB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;YAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;QACtB,CAAC;IACL,CAAC;;AA3GL,uCA4GC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import SpeechFlowNode from "./speechflow-node";
|
|
2
|
+
export default class SpeechFlowNodeGender extends SpeechFlowNode {
|
|
3
|
+
static name: string;
|
|
4
|
+
private static speexInitialized;
|
|
5
|
+
private classifier;
|
|
6
|
+
private queue;
|
|
7
|
+
private queueRecv;
|
|
8
|
+
private queueAC;
|
|
9
|
+
private queueSend;
|
|
10
|
+
private shutdown;
|
|
11
|
+
private workingOffTimer;
|
|
12
|
+
private progressInterval;
|
|
13
|
+
constructor(id: string, cfg: {
|
|
14
|
+
[id: string]: any;
|
|
15
|
+
}, opts: {
|
|
16
|
+
[id: string]: any;
|
|
17
|
+
}, args: any[]);
|
|
18
|
+
open(): Promise<void>;
|
|
19
|
+
close(): Promise<void>;
|
|
20
|
+
}
|