onProcessorMessage()

in libs/voicefocus/worklet-inline-node.js [69:88]


    onProcessorMessage(event) {
        var _a, _b, _c;
        const data = event.data;
        switch (data.message) {
            case 'cpu':
                this.cpuWarningCount++;
                const now = Date.now();
                const before = this.cpuWarningLastTriggered || now;
                const diff = Math.abs(now - before);
                if (!this.cpuWarningLastTriggered || diff > CPU_WARNING_MAX_INTERVAL_MS) {
                    (_a = this.logger) === null || _a === void 0 ? void 0 : _a.warn(`CPU warning (count: ${this.cpuWarningCount}):`, data.message);
                    this.cpuWarningCount = 0;
                    this.cpuWarningLastTriggered = now;
                }
                (_b = this.delegate) === null || _b === void 0 ? void 0 : _b.onCPUWarning();
                break;
            default:
                (_c = this.logger) === null || _c === void 0 ? void 0 : _c.debug('Ignoring processor message.');
        }
    }