mwg API
    Preparing search index...

    Function benchEngine

    • Times an engine on voices notes held at once for seconds of audio (a chord spread across the keyboard, one channel each), and reports how much of real time the synthesis uses. This is the measurement behind "does it fit the main thread, or does it need the audio core host": run it on the target machine with the engine registered, since the number belongs to that pair. A ratio near or over 1 means a dropout on the main thread; playMidiHosted is the way out.

      Parameters

      • options: { engine: string; sampleRate?: number; seconds?: number; voices?: number }

      Returns EngineBenchmark

      import { benchEngine } from '@datamoc/mwg/audio';

      const result = benchEngine({ engine: 'builtin', voices: 16, seconds: 5 });
      console.log(result.ratio < 1 ? 'keeps up' : 'does not keep up');