startAsync

fun startAsync(preferredPort: Int, whisperRelease: String, whisperReleaseBaseUrl: String, modelUrl: String, modelsDir: File, binDir: File, whisperDir: File, noGpu: Boolean, threadCount: Int?, maxRAMPercent: Double, maxComputePercent: Double, onReady: (port: Int) -> Unit)

Starts background initialization: downloads the whisper-server binary and model, ensures ffmpeg, launches the server, and starts the resource monitor.

Parameters

preferredPort

The TCP port to try first.

whisperRelease

whisper.cpp release tag (e.g. "v1.7.6").

whisperReleaseBaseUrl

Base URL prefix for whisper.cpp release downloads.

modelUrl

URL of the GGML model to download.

modelsDir

Directory to store downloaded models.

binDir

Directory to store extracted binaries.

whisperDir

Root directory for all Whisper artifacts.

noGpu

When true, GPU acceleration is disabled.

threadCount

Explicit thread count, or null to auto-detect.

maxRAMPercent

RAM usage threshold for resource gating.

maxComputePercent

Compute usage threshold for resource gating.

onReady

Called when the server is fully ready (for updating static port fields).