AIModel Registry
Global registry for AI model providers.
Allows apps to register model loaders once at startup, which are then automatically used by com.musicmuni.voxatrace.tona.PitchDetection and com.musicmuni.voxatrace.calibra.CalibraVAD factories when creating AI-based detectors.
Zero-Config Usage (Recommended)
After calling VT.initialize(), models are auto-loaded from bundled assets:
// At app startup
VT.initializeWithApiKey("api_key", context)
// Later, anywhere in the app - models auto-load from bundled assets
val detector = PitchDetection.createDetector(config)
val vad = CalibraVAD.create(VADModelProvider.speech())Sideloading Custom Models
To use custom models instead of bundled ones, register providers:
// Override globally
AIModelRegistry.registerSwiftF0 { loadCustomPitchModel() }
AIModelRegistry.registerSpeechVAD { loadCustomSileroModel() }
// Or per-call (supported by factory methods)
val vad = CalibraVAD.create(VADModelProvider.speech { customLoader() })Functions
Check if Singing VAD models are available (registered or bundled).
Check if Speech VAD model is available (registered or bundled).
Check if SwiftF0 model is available (registered or bundled).
Register Speech VAD (Silero) model provider for automatic loading.
Register SwiftF0 model provider for automatic loading. Used by com.musicmuni.voxatrace.tona.PitchDetection and SingingRealtime VAD.