speechflow 1.6.3 → 1.6.5
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/.claude/settings.local.json +3 -0
- package/CHANGELOG.md +20 -0
- package/README.md +87 -48
- package/etc/speechflow.yaml +21 -14
- package/package.json +5 -5
- package/speechflow-cli/dst/speechflow-main-api.js +3 -7
- package/speechflow-cli/dst/speechflow-main-api.js.map +1 -1
- package/speechflow-cli/dst/speechflow-main-graph.js +1 -1
- package/speechflow-cli/dst/speechflow-main.js +6 -0
- package/speechflow-cli/dst/speechflow-main.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-compressor-wt.js +1 -21
- package/speechflow-cli/dst/speechflow-node-a2a-compressor-wt.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-compressor.js +2 -1
- package/speechflow-cli/dst/speechflow-node-a2a-compressor.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-expander-wt.js +1 -21
- package/speechflow-cli/dst/speechflow-node-a2a-expander-wt.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-expander.js +2 -1
- package/speechflow-cli/dst/speechflow-node-a2a-expander.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-ffmpeg.js +2 -2
- package/speechflow-cli/dst/speechflow-node-a2a-ffmpeg.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-gender.js +38 -42
- package/speechflow-cli/dst/speechflow-node-a2a-gender.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-meter.js +59 -40
- package/speechflow-cli/dst/speechflow-node-a2a-meter.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-rnnoise.js +1 -0
- package/speechflow-cli/dst/speechflow-node-a2a-rnnoise.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2a-vad.js +2 -2
- package/speechflow-cli/dst/speechflow-node-a2a-vad.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2t-openai.d.ts +0 -1
- package/speechflow-cli/dst/speechflow-node-a2t-openai.js +0 -6
- package/speechflow-cli/dst/speechflow-node-a2t-openai.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-amazon.d.ts +0 -1
- package/speechflow-cli/dst/speechflow-node-t2a-amazon.js +0 -6
- package/speechflow-cli/dst/speechflow-node-t2a-amazon.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.d.ts +0 -1
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js +0 -6
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-kokoro.d.ts +0 -1
- package/speechflow-cli/dst/speechflow-node-t2a-kokoro.js +0 -6
- package/speechflow-cli/dst/speechflow-node-t2a-kokoro.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-ollama.js +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-ollama.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-subtitle.js +6 -6
- package/speechflow-cli/dst/speechflow-node-t2t-subtitle.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-x2x-trace.d.ts +1 -0
- package/speechflow-cli/dst/speechflow-node-x2x-trace.js +22 -2
- package/speechflow-cli/dst/speechflow-node-x2x-trace.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-xio-device.js +3 -2
- package/speechflow-cli/dst/speechflow-node-xio-device.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-xio-websocket.js.map +1 -1
- package/speechflow-cli/dst/speechflow-util-audio.d.ts +1 -0
- package/speechflow-cli/dst/speechflow-util-audio.js +21 -0
- package/speechflow-cli/dst/speechflow-util-audio.js.map +1 -1
- package/speechflow-cli/dst/speechflow-util-error.d.ts +1 -1
- package/speechflow-cli/dst/speechflow-util-error.js +7 -1
- package/speechflow-cli/dst/speechflow-util-error.js.map +1 -1
- package/speechflow-cli/dst/speechflow-util-stream.d.ts +1 -1
- package/speechflow-cli/dst/speechflow-util-stream.js +2 -2
- package/speechflow-cli/dst/speechflow-util-stream.js.map +1 -1
- package/speechflow-cli/etc/oxlint.jsonc +2 -1
- package/speechflow-cli/etc/stx.conf +6 -10
- package/speechflow-cli/package.json +19 -19
- package/speechflow-cli/src/speechflow-main-api.ts +6 -13
- package/speechflow-cli/src/speechflow-main-graph.ts +1 -1
- package/speechflow-cli/src/speechflow-main.ts +4 -0
- package/speechflow-cli/src/speechflow-node-a2a-compressor-wt.ts +1 -29
- package/speechflow-cli/src/speechflow-node-a2a-compressor.ts +2 -1
- package/speechflow-cli/src/speechflow-node-a2a-expander-wt.ts +1 -29
- package/speechflow-cli/src/speechflow-node-a2a-expander.ts +2 -1
- package/speechflow-cli/src/speechflow-node-a2a-ffmpeg.ts +2 -2
- package/speechflow-cli/src/speechflow-node-a2a-gender.ts +44 -39
- package/speechflow-cli/src/speechflow-node-a2a-meter.ts +67 -44
- package/speechflow-cli/src/speechflow-node-a2a-rnnoise.ts +1 -0
- package/speechflow-cli/src/speechflow-node-a2a-vad.ts +2 -2
- package/speechflow-cli/src/speechflow-node-a2t-openai.ts +0 -6
- package/speechflow-cli/src/speechflow-node-t2a-amazon.ts +0 -6
- package/speechflow-cli/src/speechflow-node-t2a-elevenlabs.ts +0 -6
- package/speechflow-cli/src/speechflow-node-t2a-kokoro.ts +0 -6
- package/speechflow-cli/src/speechflow-node-t2t-ollama.ts +1 -1
- package/speechflow-cli/src/speechflow-node-t2t-subtitle.ts +10 -14
- package/speechflow-cli/src/speechflow-node-x2x-trace.ts +25 -2
- package/speechflow-cli/src/speechflow-node-xio-device.ts +3 -2
- package/speechflow-cli/src/speechflow-node-xio-websocket.ts +1 -1
- package/speechflow-cli/src/speechflow-util-audio.ts +30 -0
- package/speechflow-cli/src/speechflow-util-error.ts +9 -3
- package/speechflow-cli/src/speechflow-util-stream.ts +2 -2
- package/speechflow-ui-db/dst/index.js +24 -33
- package/speechflow-ui-db/package.json +14 -12
- package/speechflow-ui-db/src/app.vue +30 -7
- package/speechflow-ui-st/.claude/settings.local.json +3 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-BoldIt.eot +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-BoldIt.ttf +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-BoldIt.woff +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-RegularIt.eot +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-RegularIt.ttf +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-RegularIt.woff +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Semibold.eot +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Semibold.ttf +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-Semibold.woff +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-SemiboldIt.eot +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-SemiboldIt.ttf +0 -0
- package/speechflow-ui-st/dst/app-font-TypoPRO-SourceSansPro-SemiboldIt.woff +0 -0
- package/speechflow-ui-st/dst/index.css +2 -2
- package/speechflow-ui-st/dst/index.js +461 -28
- package/speechflow-ui-st/package.json +14 -13
- package/speechflow-ui-st/src/app.vue +150 -51
- package/speechflow-ui-st/src/index.ts +4 -0
- package/speechflow-cli/dst/speechflow-util-webaudio-wt.d.ts +0 -1
- package/speechflow-cli/dst/speechflow-util-webaudio-wt.js +0 -124
- package/speechflow-cli/dst/speechflow-util-webaudio-wt.js.map +0 -1
- package/speechflow-cli/dst/speechflow-util-webaudio.d.ts +0 -13
- package/speechflow-cli/dst/speechflow-util-webaudio.js +0 -137
- package/speechflow-cli/dst/speechflow-util-webaudio.js.map +0 -1
|
@@ -132,6 +132,36 @@ export async function processInt16ArrayInSegments (
|
|
|
132
132
|
return data
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/* update envelope (smoothed amplitude contour) for single channel */
|
|
136
|
+
export function updateEnvelopeForChannel(
|
|
137
|
+
env: number[],
|
|
138
|
+
sampleRate: number,
|
|
139
|
+
chan: number,
|
|
140
|
+
samples: Float32Array,
|
|
141
|
+
attack: number,
|
|
142
|
+
release: number
|
|
143
|
+
): number {
|
|
144
|
+
/* fetch old envelope value */
|
|
145
|
+
if (env[chan] === undefined)
|
|
146
|
+
env[chan] = 1e-12
|
|
147
|
+
let currentEnv = env[chan]
|
|
148
|
+
|
|
149
|
+
/* calculate attack/release alpha values */
|
|
150
|
+
const alphaA = Math.exp(-1 / (attack * sampleRate))
|
|
151
|
+
const alphaR = Math.exp(-1 / (release * sampleRate))
|
|
152
|
+
|
|
153
|
+
/* iterate over all samples and calculate RMS */
|
|
154
|
+
for (const s of samples) {
|
|
155
|
+
const x = Math.abs(s)
|
|
156
|
+
const det = x * x
|
|
157
|
+
if (det > currentEnv)
|
|
158
|
+
currentEnv = alphaA * currentEnv + (1 - alphaA) * det
|
|
159
|
+
else
|
|
160
|
+
currentEnv = alphaR * currentEnv + (1 - alphaR) * det
|
|
161
|
+
}
|
|
162
|
+
return Math.sqrt(Math.max(currentEnv, 1e-12))
|
|
163
|
+
}
|
|
164
|
+
|
|
135
165
|
/* helper functions for linear/decibel conversions */
|
|
136
166
|
export function lin2dB (x: number): number {
|
|
137
167
|
return 20 * Math.log10(Math.max(x, 1e-12))
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* helper function for promise-based timeout */
|
|
8
|
-
export function timeoutPromise (duration: number = 10 * 1000, info = "timeout") {
|
|
9
|
-
return new Promise<
|
|
8
|
+
export function timeoutPromise<T = void> (duration: number = 10 * 1000, info = "timeout") {
|
|
9
|
+
return new Promise<T>((resolve, reject) => {
|
|
10
10
|
setTimeout(() => { reject(new Error(info)) }, duration)
|
|
11
11
|
})
|
|
12
12
|
}
|
|
@@ -21,7 +21,13 @@ export function ensureError (error: unknown, prefix?: string, debug = false): Er
|
|
|
21
21
|
msg = `${prefix}: ${msg}`
|
|
22
22
|
if (debug && error instanceof Error)
|
|
23
23
|
msg = `${msg}\n${error.stack}`
|
|
24
|
-
|
|
24
|
+
if (error instanceof Error) {
|
|
25
|
+
const err = new Error(msg, { cause: error })
|
|
26
|
+
err.stack = error.stack
|
|
27
|
+
return err
|
|
28
|
+
}
|
|
29
|
+
else
|
|
30
|
+
return new Error(msg)
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
/* helper function for retrieving a Promise object */
|
|
@@ -36,12 +36,12 @@ export function createTransformStreamForWritableSide () {
|
|
|
36
36
|
|
|
37
37
|
/* create a Duplex/Transform stream which has
|
|
38
38
|
object-mode on Readable side and buffer/string-mode on Writable side */
|
|
39
|
-
export function createTransformStreamForReadableSide (type: "text" | "audio", getTimeZero: () => DateTime) {
|
|
39
|
+
export function createTransformStreamForReadableSide (type: "text" | "audio", getTimeZero: () => DateTime, highWaterMark?: number) {
|
|
40
40
|
return new Stream.Transform({
|
|
41
41
|
readableObjectMode: true,
|
|
42
42
|
writableObjectMode: true,
|
|
43
43
|
decodeStrings: false,
|
|
44
|
-
highWaterMark: (type === "audio" ? 19200 : 65536), /* audio: 400ms @ 48kHz/16bit/mono, text: 64KB */
|
|
44
|
+
highWaterMark: highWaterMark ?? (type === "audio" ? 19200 : 65536), /* audio: 400ms @ 48kHz/16bit/mono, text: 64KB */
|
|
45
45
|
transform (chunk: Buffer | string, encoding, callback) {
|
|
46
46
|
if (chunk === null) {
|
|
47
47
|
this.push(null)
|