Updates
Rolling release / release (push) Failing after 1m24s

This commit is contained in:
2026-09-11 19:36:12 -04:00
parent 7604cded2c
commit a78708f8ff
26 changed files with 298 additions and 59 deletions
+9 -5
View File
@@ -7,11 +7,15 @@ export class PipeWirePlayback extends EventEmitter {
}
async play(samples) {
this.stop();
const child = this.process = this.spawnImpl(this.command, ['--playback', '--raw', '--format', 's16', '--rate', String(this.sampleRate), '--channels', '1', '--name', this.nodeName], { stdio: ['pipe', 'ignore', 'pipe'] });
child.stderr?.on('data', (chunk) => this.emit('diagnostic', String(chunk).trim()));
child.on('error', (error) => this.emit('error', error));
child.stdin.end(Buffer.from(samples.buffer, samples.byteOffset, samples.byteLength));
await new Promise((resolve, reject) => { child.once('close', resolve); child.once('error', reject); });
const child = this.process = this.spawnImpl(this.command, ['--playback', '--raw', '--format', 's16', '--rate', String(this.sampleRate), '--channels', '1', '--properties', `node.name=${this.nodeName}`, '-'], { stdio: ['pipe', 'ignore', 'pipe'] });
let diagnostic = '';
child.stderr?.on('data', (chunk) => { diagnostic = (diagnostic + String(chunk)).slice(-2048); this.emit('diagnostic', String(chunk).trim()); });
await new Promise((resolve, reject) => {
child.once('close', (code, signal) => code === 0 || signal === 'SIGTERM' ? resolve() : reject(new Error(`Audio playback exited with code ${code}: ${diagnostic.trim()}`)));
child.once('error', reject);
child.stdin.on('error', reject);
child.stdin.end(Buffer.from(samples.buffer, samples.byteOffset, samples.byteLength));
});
if (this.process === child) this.process = null;
}
stop() { if (this.process) { this.process.kill('SIGTERM'); this.process = null; } }