Check Point
Rolling release / release (push) Successful in 6m36s

This commit is contained in:
2026-09-12 09:07:09 -04:00
parent e9040d110a
commit a4073b9020
63 changed files with 2459 additions and 632 deletions
+3 -2
View File
@@ -8,12 +8,13 @@ export const MIC_FORMAT = 's16';
/** Raw 16 kHz mono capture from PipeWire. The process is deliberately kept
* outside gnome-shell and has a stable node name for routing in Helvum. */
export class PipeWireCapture extends EventEmitter {
constructor({ command = 'pw-cat', spawnImpl = spawn, sampleRate = MIC_SAMPLE_RATE, nodeName = 'Jarvis' } = {}) {
constructor({ command = 'pw-cat', spawnImpl = spawn, sampleRate = MIC_SAMPLE_RATE, nodeName = 'Jarvis', target = '' } = {}) {
super();
this.command = command;
this.spawnImpl = spawnImpl;
this.sampleRate = sampleRate;
this.nodeName = nodeName;
this.target = target;
this.process = null;
}
@@ -21,7 +22,7 @@ export class PipeWireCapture extends EventEmitter {
if (this.process) return this;
this.process = this.spawnImpl(this.command, [
'--record', '--raw', '--format', MIC_FORMAT, '--rate', String(this.sampleRate),
'--channels', String(MIC_CHANNELS), '--properties', `node.name=${this.nodeName}`, '-',
'--channels', String(MIC_CHANNELS), ...(this.target ? ['--target', this.target] : []), '--properties', `node.name=${this.nodeName}`, '-',
], { stdio: ['ignore', 'pipe', 'pipe'] });
this.process.stdout?.on('data', (chunk) => this.emit('audio', Buffer.from(chunk)));
this.process.stderr?.on('data', (chunk) => this.emit('diagnostic', String(chunk).trim()));