@geravant/sinain 1.6.0 → 1.6.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/package.json
CHANGED
|
@@ -99,7 +99,7 @@ export class AudioPipeline extends EventEmitter {
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
log(TAG, `starting capture: device=${this.config.device} cmd=${this.config.captureCommand} rate=${this.config.sampleRate}`);
|
|
102
|
+
log(TAG, `starting capture: device=${this.config.device} cmd=${this.config.captureCommand} rate=${this.config.sampleRate}${this.config.gainDb ? ` gain=${this.config.gainDb}dB` : ""}`);
|
|
103
103
|
|
|
104
104
|
try {
|
|
105
105
|
this.spawnCaptureProcess();
|
|
@@ -295,6 +295,16 @@ export class AudioPipeline extends EventEmitter {
|
|
|
295
295
|
|
|
296
296
|
if (alignedPcm.length === 0) return;
|
|
297
297
|
|
|
298
|
+
// Apply gain (amplify quiet ScreenCaptureKit audio before VAD + transcription)
|
|
299
|
+
if (this.config.gainDb !== 0) {
|
|
300
|
+
const multiplier = Math.pow(10, this.config.gainDb / 20);
|
|
301
|
+
for (let i = 0; i < alignedPcm.length - 1; i += 2) {
|
|
302
|
+
const sample = alignedPcm.readInt16LE(i);
|
|
303
|
+
const amplified = Math.max(-32768, Math.min(32767, Math.round(sample * multiplier)));
|
|
304
|
+
alignedPcm.writeInt16LE(amplified, i);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
298
308
|
const energy = calculateRmsEnergy(alignedPcm);
|
|
299
309
|
this.profiler?.gauge("audio.lastChunkKb", Math.round(alignedPcm.length / 1024));
|
|
300
310
|
|
|
@@ -492,7 +492,6 @@ ${recentLines.join("\n")}`;
|
|
|
492
492
|
|
|
493
493
|
// Generate a unique child session key — bypasses the main agent entirely
|
|
494
494
|
const childSessionKey = `agent:main:subagent:${randomUUID()}`;
|
|
495
|
-
const mainSessionKey = this.deps.openclawConfig.sessionKey;
|
|
496
495
|
|
|
497
496
|
this.outboundBytes += Buffer.byteLength(task);
|
|
498
497
|
this.deps.profiler?.gauge("network.escalationOutBytes", this.outboundBytes);
|
|
@@ -523,7 +522,6 @@ ${recentLines.join("\n")}`;
|
|
|
523
522
|
lane: "subagent",
|
|
524
523
|
extraSystemPrompt: this.buildChildSystemPrompt(task, label),
|
|
525
524
|
deliver: false,
|
|
526
|
-
spawnedBy: mainSessionKey,
|
|
527
525
|
idempotencyKey: idemKey,
|
|
528
526
|
label: label || undefined,
|
|
529
527
|
}, 45_000, { expectFinal: true });
|