@runanywhere/core 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RunAnywhereCore.podspec +130 -0
- package/android/CMakeLists.txt +92 -0
- package/android/build.gradle +321 -0
- package/android/consumer-rules.pro +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +271 -0
- package/android/src/main/include/rac/backends/rac_llm_llamacpp.h +218 -0
- package/android/src/main/include/rac/backends/rac_stt_onnx.h +99 -0
- package/android/src/main/include/rac/backends/rac_stt_whispercpp.h +153 -0
- package/android/src/main/include/rac/backends/rac_tts_onnx.h +71 -0
- package/android/src/main/include/rac/backends/rac_vad_onnx.h +84 -0
- package/android/src/main/include/rac/core/capabilities/rac_lifecycle.h +290 -0
- package/android/src/main/include/rac/core/rac_analytics_events.h +610 -0
- package/android/src/main/include/rac/core/rac_audio_utils.h +88 -0
- package/android/src/main/include/rac/core/rac_component_types.h +160 -0
- package/android/src/main/include/rac/core/rac_core.h +331 -0
- package/android/src/main/include/rac/core/rac_error.h +469 -0
- package/android/src/main/include/rac/core/rac_events.h +334 -0
- package/android/src/main/include/rac/core/rac_logger.h +416 -0
- package/android/src/main/include/rac/core/rac_platform_adapter.h +340 -0
- package/android/src/main/include/rac/core/rac_sdk_state.h +292 -0
- package/android/src/main/include/rac/core/rac_structured_error.h +594 -0
- package/android/src/main/include/rac/core/rac_types.h +264 -0
- package/android/src/main/include/rac/features/llm/rac_llm.h +17 -0
- package/android/src/main/include/rac/features/llm/rac_llm_analytics.h +188 -0
- package/android/src/main/include/rac/features/llm/rac_llm_component.h +228 -0
- package/android/src/main/include/rac/features/llm/rac_llm_events.h +215 -0
- package/android/src/main/include/rac/features/llm/rac_llm_metrics.h +402 -0
- package/android/src/main/include/rac/features/llm/rac_llm_service.h +163 -0
- package/android/src/main/include/rac/features/llm/rac_llm_structured_output.h +141 -0
- package/android/src/main/include/rac/features/llm/rac_llm_types.h +384 -0
- package/android/src/main/include/rac/features/platform/rac_llm_platform.h +204 -0
- package/android/src/main/include/rac/features/platform/rac_tts_platform.h +197 -0
- package/android/src/main/include/rac/features/stt/rac_stt.h +17 -0
- package/android/src/main/include/rac/features/stt/rac_stt_analytics.h +204 -0
- package/android/src/main/include/rac/features/stt/rac_stt_component.h +162 -0
- package/android/src/main/include/rac/features/stt/rac_stt_events.h +62 -0
- package/android/src/main/include/rac/features/stt/rac_stt_service.h +154 -0
- package/android/src/main/include/rac/features/stt/rac_stt_types.h +389 -0
- package/android/src/main/include/rac/features/tts/rac_tts.h +17 -0
- package/android/src/main/include/rac/features/tts/rac_tts_analytics.h +181 -0
- package/android/src/main/include/rac/features/tts/rac_tts_component.h +158 -0
- package/android/src/main/include/rac/features/tts/rac_tts_events.h +54 -0
- package/android/src/main/include/rac/features/tts/rac_tts_service.h +162 -0
- package/android/src/main/include/rac/features/tts/rac_tts_types.h +374 -0
- package/android/src/main/include/rac/features/vad/rac_vad.h +17 -0
- package/android/src/main/include/rac/features/vad/rac_vad_analytics.h +236 -0
- package/android/src/main/include/rac/features/vad/rac_vad_component.h +185 -0
- package/android/src/main/include/rac/features/vad/rac_vad_energy.h +443 -0
- package/android/src/main/include/rac/features/vad/rac_vad_events.h +76 -0
- package/android/src/main/include/rac/features/vad/rac_vad_service.h +167 -0
- package/android/src/main/include/rac/features/vad/rac_vad_types.h +244 -0
- package/android/src/main/include/rac/features/voice_agent/rac_voice_agent.h +612 -0
- package/android/src/main/include/rac/infrastructure/device/rac_device_manager.h +176 -0
- package/android/src/main/include/rac/infrastructure/download/rac_download.h +418 -0
- package/android/src/main/include/rac/infrastructure/events/rac_events.h +177 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_assignment.h +169 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_paths.h +258 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_registry.h +357 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_strategy.h +374 -0
- package/android/src/main/include/rac/infrastructure/model_management/rac_model_types.h +613 -0
- package/android/src/main/include/rac/infrastructure/network/rac_api_types.h +335 -0
- package/android/src/main/include/rac/infrastructure/network/rac_auth_manager.h +252 -0
- package/android/src/main/include/rac/infrastructure/network/rac_dev_config.h +85 -0
- package/android/src/main/include/rac/infrastructure/network/rac_endpoints.h +102 -0
- package/android/src/main/include/rac/infrastructure/network/rac_environment.h +220 -0
- package/android/src/main/include/rac/infrastructure/network/rac_http_client.h +233 -0
- package/android/src/main/include/rac/infrastructure/storage/rac_storage_analyzer.h +286 -0
- package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_manager.h +206 -0
- package/android/src/main/include/rac/infrastructure/telemetry/rac_telemetry_types.h +234 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/ArchiveUtility.kt +308 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfo.kt +229 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/PlatformAdapterBridge.kt +392 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/RunAnywhereCorePackage.kt +28 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/SDKLogger.kt +357 -0
- package/android/src/main/java/com/margelo/nitro/runanywhere/SecureStorageManager.kt +147 -0
- package/android/src/main/jniLibs/arm64-v8a/libc++_shared.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libomp.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librac_commons.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librunanywhere_jni.so +0 -0
- package/cpp/HybridRunAnywhereCore.cpp +2505 -0
- package/cpp/HybridRunAnywhereCore.hpp +271 -0
- package/cpp/bridges/AuthBridge.cpp +209 -0
- package/cpp/bridges/AuthBridge.hpp +157 -0
- package/cpp/bridges/DeviceBridge.cpp +257 -0
- package/cpp/bridges/DeviceBridge.hpp +155 -0
- package/cpp/bridges/DownloadBridge.cpp +299 -0
- package/cpp/bridges/DownloadBridge.hpp +197 -0
- package/cpp/bridges/EventBridge.cpp +125 -0
- package/cpp/bridges/EventBridge.hpp +139 -0
- package/cpp/bridges/HTTPBridge.cpp +96 -0
- package/cpp/bridges/HTTPBridge.hpp +144 -0
- package/cpp/bridges/InitBridge.cpp +1273 -0
- package/cpp/bridges/InitBridge.hpp +306 -0
- package/cpp/bridges/ModelRegistryBridge.cpp +394 -0
- package/cpp/bridges/ModelRegistryBridge.hpp +177 -0
- package/cpp/bridges/StorageBridge.cpp +269 -0
- package/cpp/bridges/StorageBridge.hpp +172 -0
- package/cpp/bridges/TelemetryBridge.cpp +352 -0
- package/cpp/bridges/TelemetryBridge.hpp +126 -0
- package/ios/.testlocal +0 -0
- package/ios/ArchiveUtility.swift +526 -0
- package/ios/ArchiveUtilityBridge.m +52 -0
- package/ios/AudioDecoder.h +38 -0
- package/ios/AudioDecoder.m +162 -0
- package/ios/Binaries/RACommons.xcframework/Info.plist +44 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/RACommons.h +67 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_analytics_events.h +610 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_api_types.h +335 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_audio_utils.h +88 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_auth_manager.h +252 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_component_types.h +160 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_core.h +331 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_dev_config.h +85 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_device_manager.h +176 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_download.h +418 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_endpoints.h +102 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_environment.h +220 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_error.h +469 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_events.h +177 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_http_client.h +233 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_lifecycle.h +290 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_component.h +228 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_events.h +215 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_platform.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_service.h +163 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_llm_types.h +384 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_logger.h +416 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_assignment.h +169 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_paths.h +258 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_registry.h +357 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_strategy.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_model_types.h +613 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_sdk_state.h +292 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_structured_error.h +594 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_component.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_events.h +62 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_service.h +154 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_types.h +389 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_component.h +158 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_events.h +54 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_platform.h +197 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_service.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_tts_types.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_types.h +264 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_component.h +185 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_energy.h +443 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_events.h +76 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_service.h +167 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_types.h +244 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_voice_agent.h +612 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Info.plist +11 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Modules/module.modulemap +5 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/RACommons +0 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/RACommons.h +67 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_analytics_events.h +610 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_api_types.h +335 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_audio_utils.h +88 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_auth_manager.h +252 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_component_types.h +160 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_core.h +331 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_dev_config.h +85 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_device_manager.h +176 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_download.h +418 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_endpoints.h +102 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_environment.h +220 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_error.h +469 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_events.h +177 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_http_client.h +233 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_lifecycle.h +290 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_analytics.h +188 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_component.h +228 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_events.h +215 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_llamacpp.h +218 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_metrics.h +402 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_platform.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_service.h +163 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_structured_output.h +141 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_llm_types.h +384 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_logger.h +416 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_assignment.h +169 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_paths.h +258 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_registry.h +357 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_strategy.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_model_types.h +613 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_platform_adapter.h +340 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_sdk_state.h +292 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_storage_analyzer.h +286 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_structured_error.h +594 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_analytics.h +204 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_component.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_events.h +62 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_onnx.h +99 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_service.h +154 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_types.h +389 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_stt_whispercpp.h +153 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_manager.h +206 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_telemetry_types.h +234 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_analytics.h +181 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_component.h +158 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_events.h +54 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_onnx.h +71 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_platform.h +197 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_service.h +162 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_tts_types.h +374 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_types.h +264 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad.h +17 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_analytics.h +236 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_component.h +185 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_energy.h +443 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_events.h +76 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_onnx.h +84 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_service.h +167 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_vad_types.h +244 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/rac_voice_agent.h +612 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Info.plist +11 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Modules/module.modulemap +5 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/RACommons +0 -0
- package/ios/HybridRunAnywhereDeviceInfo.swift +214 -0
- package/ios/KeychainManager.swift +116 -0
- package/ios/PlatformAdapter.swift +100 -0
- package/ios/PlatformAdapterBridge.h +152 -0
- package/ios/PlatformAdapterBridge.m +570 -0
- package/ios/RNSDKLoggerBridge.h +41 -0
- package/ios/RNSDKLoggerBridge.m +66 -0
- package/ios/SDKLogger.swift +329 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.cpp +257 -0
- package/nitrogen/generated/android/c++/JHybridRunAnywhereDeviceInfoSpec.hpp +77 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/HybridRunAnywhereDeviceInfoSpec.kt +106 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/runanywhere/runanywherecoreOnLoad.kt +35 -0
- package/nitrogen/generated/android/runanywherecore+autolinking.cmake +82 -0
- package/nitrogen/generated/android/runanywherecore+autolinking.gradle +27 -0
- package/nitrogen/generated/android/runanywherecoreOnLoad.cpp +54 -0
- package/nitrogen/generated/android/runanywherecoreOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/RunAnywhereCore+autolinking.rb +60 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.cpp +65 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Bridge.hpp +197 -0
- package/nitrogen/generated/ios/RunAnywhereCore-Swift-Cxx-Umbrella.hpp +45 -0
- package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.mm +43 -0
- package/nitrogen/generated/ios/RunAnywhereCoreAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridRunAnywhereDeviceInfoSpecSwift.hpp +173 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec.swift +68 -0
- package/nitrogen/generated/ios/swift/HybridRunAnywhereDeviceInfoSpec_cxx.swift +366 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.cpp +92 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp +138 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.cpp +33 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereDeviceInfoSpec.hpp +75 -0
- package/package.json +76 -0
- package/react-native.config.js +14 -0
- package/src/Features/VoiceSession/AudioCaptureManager.ts +286 -0
- package/src/Features/VoiceSession/AudioPlaybackManager.ts +300 -0
- package/src/Features/VoiceSession/VoiceSessionHandle.ts +530 -0
- package/src/Features/VoiceSession/index.ts +20 -0
- package/src/Features/index.ts +7 -0
- package/src/Foundation/Constants/SDKConstants.ts +47 -0
- package/src/Foundation/Constants/index.ts +8 -0
- package/src/Foundation/DependencyInjection/ServiceContainer.ts +154 -0
- package/src/Foundation/DependencyInjection/ServiceRegistry.ts +51 -0
- package/src/Foundation/DependencyInjection/index.ts +6 -0
- package/src/Foundation/ErrorTypes/ErrorCategory.ts +184 -0
- package/src/Foundation/ErrorTypes/ErrorCodes.ts +151 -0
- package/src/Foundation/ErrorTypes/ErrorContext.ts +201 -0
- package/src/Foundation/ErrorTypes/SDKError.ts +507 -0
- package/src/Foundation/ErrorTypes/index.ts +57 -0
- package/src/Foundation/Initialization/InitializationPhase.ts +85 -0
- package/src/Foundation/Initialization/InitializationState.ts +168 -0
- package/src/Foundation/Initialization/index.ts +26 -0
- package/src/Foundation/Logging/Destinations/NativeLogBridge.ts +147 -0
- package/src/Foundation/Logging/Destinations/SentryDestination.ts +209 -0
- package/src/Foundation/Logging/Logger/SDKLogger.ts +232 -0
- package/src/Foundation/Logging/Models/LogLevel.ts +36 -0
- package/src/Foundation/Logging/Models/LoggingConfiguration.ts +117 -0
- package/src/Foundation/Logging/Services/LoggingManager.ts +407 -0
- package/src/Foundation/Logging/index.ts +59 -0
- package/src/Foundation/Security/DeviceIdentity.ts +92 -0
- package/src/Foundation/Security/SecureStorageError.ts +132 -0
- package/src/Foundation/Security/SecureStorageKeys.ts +35 -0
- package/src/Foundation/Security/SecureStorageService.ts +449 -0
- package/src/Foundation/Security/index.ts +17 -0
- package/src/Foundation/index.ts +26 -0
- package/src/Infrastructure/Events/EventPublisher.ts +165 -0
- package/src/Infrastructure/Events/SDKEvent.ts +214 -0
- package/src/Infrastructure/Events/index.ts +15 -0
- package/src/Infrastructure/index.ts +9 -0
- package/src/Public/Events/EventBus.ts +488 -0
- package/src/Public/Events/index.ts +8 -0
- package/src/Public/Extensions/RunAnywhere+Logging.ts +51 -0
- package/src/Public/Extensions/RunAnywhere+Models.ts +392 -0
- package/src/Public/Extensions/RunAnywhere+STT.ts +424 -0
- package/src/Public/Extensions/RunAnywhere+Storage.ts +151 -0
- package/src/Public/Extensions/RunAnywhere+StructuredOutput.ts +316 -0
- package/src/Public/Extensions/RunAnywhere+TTS.ts +430 -0
- package/src/Public/Extensions/RunAnywhere+TextGeneration.ts +320 -0
- package/src/Public/Extensions/RunAnywhere+VAD.ts +359 -0
- package/src/Public/Extensions/RunAnywhere+VoiceAgent.ts +225 -0
- package/src/Public/Extensions/RunAnywhere+VoiceSession.ts +155 -0
- package/src/Public/Extensions/index.ts +126 -0
- package/src/Public/RunAnywhere.ts +695 -0
- package/src/index.ts +238 -0
- package/src/native/NativeRunAnywhereCore.ts +291 -0
- package/src/native/NativeRunAnywhereModule.ts +32 -0
- package/src/native/index.ts +21 -0
- package/src/services/DownloadService.ts +282 -0
- package/src/services/FileSystem.ts +810 -0
- package/src/services/ModelRegistry.ts +246 -0
- package/src/services/Network/APIEndpoints.ts +84 -0
- package/src/services/Network/HTTPService.ts +479 -0
- package/src/services/Network/NetworkConfiguration.ts +130 -0
- package/src/services/Network/TelemetryService.ts +318 -0
- package/src/services/Network/index.ts +29 -0
- package/src/services/SystemTTSService.ts +130 -0
- package/src/services/index.ts +66 -0
- package/src/specs/RunAnywhereCore.nitro.ts +627 -0
- package/src/specs/RunAnywhereDeviceInfo.nitro.ts +73 -0
- package/src/types/LLMTypes.ts +127 -0
- package/src/types/STTTypes.ts +124 -0
- package/src/types/StructuredOutputTypes.ts +156 -0
- package/src/types/TTSTypes.ts +126 -0
- package/src/types/VADTypes.ts +70 -0
- package/src/types/VoiceAgentTypes.ts +182 -0
- package/src/types/enums.ts +258 -0
- package/src/types/events.ts +337 -0
- package/src/types/external.d.ts +142 -0
- package/src/types/index.ts +146 -0
- package/src/types/models.ts +579 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_service.h
|
|
3
|
+
* @brief RunAnywhere Commons - VAD Service Interface (Protocol)
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's VADService protocol from:
|
|
6
|
+
* Sources/RunAnywhere/Features/VAD/Protocol/VADService.swift
|
|
7
|
+
*
|
|
8
|
+
* This header defines the service interface. For data types,
|
|
9
|
+
* see rac_vad_types.h.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef RAC_VAD_SERVICE_H
|
|
13
|
+
#define RAC_VAD_SERVICE_H
|
|
14
|
+
|
|
15
|
+
#include "rac/core/rac_error.h"
|
|
16
|
+
#include "rac/features/vad/rac_vad_types.h"
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
extern "C" {
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// SERVICE INTERFACE - Mirrors Swift's VADService protocol
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @brief Create a VAD service
|
|
28
|
+
*
|
|
29
|
+
* @param out_handle Output: Handle to the created service
|
|
30
|
+
* @return RAC_SUCCESS or error code
|
|
31
|
+
*/
|
|
32
|
+
RAC_API rac_result_t rac_vad_create(rac_handle_t* out_handle);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @brief Initialize the VAD service
|
|
36
|
+
*
|
|
37
|
+
* Mirrors Swift's VADService.initialize()
|
|
38
|
+
*
|
|
39
|
+
* @param handle Service handle
|
|
40
|
+
* @return RAC_SUCCESS or error code
|
|
41
|
+
*/
|
|
42
|
+
RAC_API rac_result_t rac_vad_initialize(rac_handle_t handle);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @brief Set speech activity callback
|
|
46
|
+
*
|
|
47
|
+
* Mirrors Swift's VADService.onSpeechActivity property.
|
|
48
|
+
*
|
|
49
|
+
* @param handle Service handle
|
|
50
|
+
* @param callback Activity callback (can be NULL to unset)
|
|
51
|
+
* @param user_data User context passed to callback
|
|
52
|
+
* @return RAC_SUCCESS or error code
|
|
53
|
+
*/
|
|
54
|
+
RAC_API rac_result_t rac_vad_set_activity_callback(rac_handle_t handle,
|
|
55
|
+
rac_vad_activity_callback_fn callback,
|
|
56
|
+
void* user_data);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @brief Set audio buffer callback
|
|
60
|
+
*
|
|
61
|
+
* Mirrors Swift's VADService.onAudioBuffer property.
|
|
62
|
+
*
|
|
63
|
+
* @param handle Service handle
|
|
64
|
+
* @param callback Audio callback (can be NULL to unset)
|
|
65
|
+
* @param user_data User context passed to callback
|
|
66
|
+
* @return RAC_SUCCESS or error code
|
|
67
|
+
*/
|
|
68
|
+
RAC_API rac_result_t rac_vad_set_audio_callback(rac_handle_t handle,
|
|
69
|
+
rac_vad_audio_callback_fn callback,
|
|
70
|
+
void* user_data);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @brief Start VAD processing
|
|
74
|
+
*
|
|
75
|
+
* Mirrors Swift's VADService.start()
|
|
76
|
+
*
|
|
77
|
+
* @param handle Service handle
|
|
78
|
+
* @return RAC_SUCCESS or error code
|
|
79
|
+
*/
|
|
80
|
+
RAC_API rac_result_t rac_vad_start(rac_handle_t handle);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @brief Stop VAD processing
|
|
84
|
+
*
|
|
85
|
+
* Mirrors Swift's VADService.stop()
|
|
86
|
+
*
|
|
87
|
+
* @param handle Service handle
|
|
88
|
+
* @return RAC_SUCCESS or error code
|
|
89
|
+
*/
|
|
90
|
+
RAC_API rac_result_t rac_vad_stop(rac_handle_t handle);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @brief Reset VAD state
|
|
94
|
+
*
|
|
95
|
+
* Mirrors Swift's VADService.reset()
|
|
96
|
+
*
|
|
97
|
+
* @param handle Service handle
|
|
98
|
+
* @return RAC_SUCCESS or error code
|
|
99
|
+
*/
|
|
100
|
+
RAC_API rac_result_t rac_vad_reset(rac_handle_t handle);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @brief Pause VAD processing
|
|
104
|
+
*
|
|
105
|
+
* Mirrors Swift's VADService.pause() (optional, default no-op)
|
|
106
|
+
*
|
|
107
|
+
* @param handle Service handle
|
|
108
|
+
* @return RAC_SUCCESS or error code
|
|
109
|
+
*/
|
|
110
|
+
RAC_API rac_result_t rac_vad_pause(rac_handle_t handle);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @brief Resume VAD processing
|
|
114
|
+
*
|
|
115
|
+
* Mirrors Swift's VADService.resume() (optional, default no-op)
|
|
116
|
+
*
|
|
117
|
+
* @param handle Service handle
|
|
118
|
+
* @return RAC_SUCCESS or error code
|
|
119
|
+
*/
|
|
120
|
+
RAC_API rac_result_t rac_vad_resume(rac_handle_t handle);
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @brief Process audio samples
|
|
124
|
+
*
|
|
125
|
+
* Mirrors Swift's VADService.processAudioData(_:)
|
|
126
|
+
*
|
|
127
|
+
* @param handle Service handle
|
|
128
|
+
* @param samples Float audio samples (PCM)
|
|
129
|
+
* @param num_samples Number of samples
|
|
130
|
+
* @param out_is_speech Output: Whether speech is detected
|
|
131
|
+
* @return RAC_SUCCESS or error code
|
|
132
|
+
*/
|
|
133
|
+
RAC_API rac_result_t rac_vad_process_samples(rac_handle_t handle, const float* samples,
|
|
134
|
+
size_t num_samples, rac_bool_t* out_is_speech);
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @brief Set energy threshold
|
|
138
|
+
*
|
|
139
|
+
* Mirrors Swift's VADService.energyThreshold setter.
|
|
140
|
+
*
|
|
141
|
+
* @param handle Service handle
|
|
142
|
+
* @param threshold New threshold (0.0 to 1.0)
|
|
143
|
+
* @return RAC_SUCCESS or error code
|
|
144
|
+
*/
|
|
145
|
+
RAC_API rac_result_t rac_vad_set_energy_threshold(rac_handle_t handle, float threshold);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @brief Get service information
|
|
149
|
+
*
|
|
150
|
+
* @param handle Service handle
|
|
151
|
+
* @param out_info Output: Service information
|
|
152
|
+
* @return RAC_SUCCESS or error code
|
|
153
|
+
*/
|
|
154
|
+
RAC_API rac_result_t rac_vad_get_info(rac_handle_t handle, rac_vad_info_t* out_info);
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @brief Destroy a VAD service instance
|
|
158
|
+
*
|
|
159
|
+
* @param handle Service handle to destroy
|
|
160
|
+
*/
|
|
161
|
+
RAC_API void rac_vad_destroy(rac_handle_t handle);
|
|
162
|
+
|
|
163
|
+
#ifdef __cplusplus
|
|
164
|
+
}
|
|
165
|
+
#endif
|
|
166
|
+
|
|
167
|
+
#endif /* RAC_VAD_SERVICE_H */
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_types.h
|
|
3
|
+
* @brief RunAnywhere Commons - VAD Types and Data Structures
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's VAD Models from:
|
|
6
|
+
* Sources/RunAnywhere/Features/VAD/Models/VADConfiguration.swift
|
|
7
|
+
* Sources/RunAnywhere/Features/VAD/Models/VADInput.swift
|
|
8
|
+
* Sources/RunAnywhere/Features/VAD/Models/VADOutput.swift
|
|
9
|
+
* Sources/RunAnywhere/Features/VAD/VADConstants.swift
|
|
10
|
+
*
|
|
11
|
+
* This header defines data structures only. For the service interface,
|
|
12
|
+
* see rac_vad_service.h.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#ifndef RAC_VAD_TYPES_H
|
|
16
|
+
#define RAC_VAD_TYPES_H
|
|
17
|
+
|
|
18
|
+
#include "rac/core/rac_types.h"
|
|
19
|
+
|
|
20
|
+
#ifdef __cplusplus
|
|
21
|
+
extern "C" {
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
// =============================================================================
|
|
25
|
+
// CONSTANTS - Single Source of Truth for VAD
|
|
26
|
+
// Swift references these via CRACommons import
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
// Audio Format Constants
|
|
30
|
+
#define RAC_VAD_DEFAULT_SAMPLE_RATE 16000
|
|
31
|
+
#define RAC_VAD_MAX_SAMPLE_RATE 48000
|
|
32
|
+
#define RAC_VAD_MIN_SAMPLE_RATE 8000
|
|
33
|
+
|
|
34
|
+
// Energy Thresholds
|
|
35
|
+
#define RAC_VAD_DEFAULT_ENERGY_THRESHOLD 0.015f
|
|
36
|
+
#define RAC_VAD_MIN_ENERGY_THRESHOLD 0.001f
|
|
37
|
+
#define RAC_VAD_MAX_ENERGY_THRESHOLD 0.5f
|
|
38
|
+
|
|
39
|
+
// Frame Processing
|
|
40
|
+
#define RAC_VAD_DEFAULT_FRAME_LENGTH 0.1f
|
|
41
|
+
#define RAC_VAD_MIN_FRAME_LENGTH 0.02f
|
|
42
|
+
#define RAC_VAD_MAX_FRAME_LENGTH 0.5f
|
|
43
|
+
|
|
44
|
+
// Calibration
|
|
45
|
+
#define RAC_VAD_DEFAULT_CALIBRATION_MULTIPLIER 2.0f
|
|
46
|
+
#define RAC_VAD_MIN_CALIBRATION_MULTIPLIER 1.2f
|
|
47
|
+
#define RAC_VAD_MAX_CALIBRATION_MULTIPLIER 5.0f
|
|
48
|
+
|
|
49
|
+
// Speech Detection
|
|
50
|
+
#define RAC_VAD_MIN_SPEECH_DURATION_MS 100
|
|
51
|
+
#define RAC_VAD_MIN_SILENCE_DURATION_MS 300
|
|
52
|
+
|
|
53
|
+
// =============================================================================
|
|
54
|
+
// CONFIGURATION - Mirrors Swift's VADConfiguration
|
|
55
|
+
// =============================================================================
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @brief VAD component configuration
|
|
59
|
+
*
|
|
60
|
+
* Mirrors Swift's VADConfiguration struct exactly.
|
|
61
|
+
* See: Sources/RunAnywhere/Features/VAD/Models/VADConfiguration.swift
|
|
62
|
+
*/
|
|
63
|
+
typedef struct rac_vad_config {
|
|
64
|
+
/** Model ID (not used for VAD, can be NULL) */
|
|
65
|
+
const char* model_id;
|
|
66
|
+
|
|
67
|
+
/** Preferred framework (use -1 for auto) */
|
|
68
|
+
int32_t preferred_framework;
|
|
69
|
+
|
|
70
|
+
/** Energy threshold for voice detection (0.0 to 1.0) */
|
|
71
|
+
float energy_threshold;
|
|
72
|
+
|
|
73
|
+
/** Sample rate in Hz (default: 16000) */
|
|
74
|
+
int32_t sample_rate;
|
|
75
|
+
|
|
76
|
+
/** Frame length in seconds (default: 0.1 = 100ms) */
|
|
77
|
+
float frame_length;
|
|
78
|
+
|
|
79
|
+
/** Enable automatic calibration */
|
|
80
|
+
rac_bool_t enable_auto_calibration;
|
|
81
|
+
|
|
82
|
+
/** Calibration multiplier (threshold = ambient noise * multiplier) */
|
|
83
|
+
float calibration_multiplier;
|
|
84
|
+
} rac_vad_config_t;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @brief Default VAD configuration
|
|
88
|
+
*/
|
|
89
|
+
static const rac_vad_config_t RAC_VAD_CONFIG_DEFAULT = {
|
|
90
|
+
.model_id = RAC_NULL,
|
|
91
|
+
.preferred_framework = -1,
|
|
92
|
+
.energy_threshold = RAC_VAD_DEFAULT_ENERGY_THRESHOLD,
|
|
93
|
+
.sample_rate = RAC_VAD_DEFAULT_SAMPLE_RATE,
|
|
94
|
+
.frame_length = RAC_VAD_DEFAULT_FRAME_LENGTH,
|
|
95
|
+
.enable_auto_calibration = RAC_FALSE,
|
|
96
|
+
.calibration_multiplier = RAC_VAD_DEFAULT_CALIBRATION_MULTIPLIER};
|
|
97
|
+
|
|
98
|
+
// =============================================================================
|
|
99
|
+
// SPEECH ACTIVITY - Mirrors Swift's SpeechActivityEvent
|
|
100
|
+
// =============================================================================
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @brief Speech activity event type
|
|
104
|
+
*
|
|
105
|
+
* Mirrors Swift's SpeechActivityEvent.
|
|
106
|
+
*/
|
|
107
|
+
typedef enum rac_speech_activity {
|
|
108
|
+
RAC_SPEECH_STARTED = 0,
|
|
109
|
+
RAC_SPEECH_ENDED = 1,
|
|
110
|
+
RAC_SPEECH_ONGOING = 2
|
|
111
|
+
} rac_speech_activity_t;
|
|
112
|
+
|
|
113
|
+
// =============================================================================
|
|
114
|
+
// INPUT - Mirrors Swift's VADInput
|
|
115
|
+
// =============================================================================
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @brief VAD input data
|
|
119
|
+
*
|
|
120
|
+
* Mirrors Swift's VADInput struct exactly.
|
|
121
|
+
* See: Sources/RunAnywhere/Features/VAD/Models/VADInput.swift
|
|
122
|
+
*/
|
|
123
|
+
typedef struct rac_vad_input {
|
|
124
|
+
/** Audio samples as float array (PCM float samples in range [-1.0, 1.0]) */
|
|
125
|
+
const float* audio_samples;
|
|
126
|
+
size_t num_samples;
|
|
127
|
+
|
|
128
|
+
/** Optional override for energy threshold (use -1 for no override) */
|
|
129
|
+
float energy_threshold_override;
|
|
130
|
+
} rac_vad_input_t;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @brief Default VAD input
|
|
134
|
+
*/
|
|
135
|
+
static const rac_vad_input_t RAC_VAD_INPUT_DEFAULT = {
|
|
136
|
+
.audio_samples = RAC_NULL,
|
|
137
|
+
.num_samples = 0,
|
|
138
|
+
.energy_threshold_override = -1.0f /* No override */
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// =============================================================================
|
|
142
|
+
// OUTPUT - Mirrors Swift's VADOutput
|
|
143
|
+
// =============================================================================
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @brief VAD output data
|
|
147
|
+
*
|
|
148
|
+
* Mirrors Swift's VADOutput struct exactly.
|
|
149
|
+
* See: Sources/RunAnywhere/Features/VAD/Models/VADOutput.swift
|
|
150
|
+
*/
|
|
151
|
+
typedef struct rac_vad_output {
|
|
152
|
+
/** Whether speech is detected in the current frame */
|
|
153
|
+
rac_bool_t is_speech_detected;
|
|
154
|
+
|
|
155
|
+
/** Current audio energy level (RMS value) */
|
|
156
|
+
float energy_level;
|
|
157
|
+
|
|
158
|
+
/** Timestamp in milliseconds since epoch */
|
|
159
|
+
int64_t timestamp_ms;
|
|
160
|
+
} rac_vad_output_t;
|
|
161
|
+
|
|
162
|
+
// =============================================================================
|
|
163
|
+
// INFO - Mirrors Swift's VADService properties
|
|
164
|
+
// =============================================================================
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @brief VAD service info
|
|
168
|
+
*
|
|
169
|
+
* Mirrors Swift's VADService properties.
|
|
170
|
+
*/
|
|
171
|
+
typedef struct rac_vad_info {
|
|
172
|
+
/** Whether speech is currently active (isSpeechActive) */
|
|
173
|
+
rac_bool_t is_speech_active;
|
|
174
|
+
|
|
175
|
+
/** Energy threshold for voice detection (energyThreshold) */
|
|
176
|
+
float energy_threshold;
|
|
177
|
+
|
|
178
|
+
/** Sample rate of the audio in Hz (sampleRate) */
|
|
179
|
+
int32_t sample_rate;
|
|
180
|
+
|
|
181
|
+
/** Frame length in seconds (frameLength) */
|
|
182
|
+
float frame_length;
|
|
183
|
+
} rac_vad_info_t;
|
|
184
|
+
|
|
185
|
+
// =============================================================================
|
|
186
|
+
// STATISTICS - Mirrors Swift's VADStatistics
|
|
187
|
+
// =============================================================================
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @brief VAD statistics
|
|
191
|
+
*
|
|
192
|
+
* Mirrors Swift's VADStatistics struct from SimpleEnergyVADService.
|
|
193
|
+
*/
|
|
194
|
+
typedef struct rac_vad_statistics {
|
|
195
|
+
/** Current calibrated threshold */
|
|
196
|
+
float current_threshold;
|
|
197
|
+
|
|
198
|
+
/** Ambient noise level */
|
|
199
|
+
float ambient_noise_level;
|
|
200
|
+
|
|
201
|
+
/** Total speech segments detected */
|
|
202
|
+
int32_t total_speech_segments;
|
|
203
|
+
|
|
204
|
+
/** Total duration of speech in milliseconds */
|
|
205
|
+
int64_t total_speech_duration_ms;
|
|
206
|
+
|
|
207
|
+
/** Average energy level */
|
|
208
|
+
float average_energy;
|
|
209
|
+
|
|
210
|
+
/** Peak energy level */
|
|
211
|
+
float peak_energy;
|
|
212
|
+
} rac_vad_statistics_t;
|
|
213
|
+
|
|
214
|
+
// =============================================================================
|
|
215
|
+
// CALLBACKS
|
|
216
|
+
// =============================================================================
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @brief Speech activity callback
|
|
220
|
+
*
|
|
221
|
+
* Mirrors Swift's VADService.onSpeechActivity callback.
|
|
222
|
+
*
|
|
223
|
+
* @param activity The speech activity event
|
|
224
|
+
* @param user_data User-provided context
|
|
225
|
+
*/
|
|
226
|
+
typedef void (*rac_vad_activity_callback_fn)(rac_speech_activity_t activity, void* user_data);
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @brief Audio buffer callback
|
|
230
|
+
*
|
|
231
|
+
* Mirrors Swift's VADService.onAudioBuffer callback.
|
|
232
|
+
*
|
|
233
|
+
* @param audio_data Audio data buffer (PCM float samples)
|
|
234
|
+
* @param num_samples Number of samples
|
|
235
|
+
* @param user_data User-provided context
|
|
236
|
+
*/
|
|
237
|
+
typedef void (*rac_vad_audio_callback_fn)(const float* audio_data, size_t num_samples,
|
|
238
|
+
void* user_data);
|
|
239
|
+
|
|
240
|
+
#ifdef __cplusplus
|
|
241
|
+
}
|
|
242
|
+
#endif
|
|
243
|
+
|
|
244
|
+
#endif /* RAC_VAD_TYPES_H */
|