@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
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_energy.h
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_energy.h
|
|
3
|
+
* @brief Energy-based Voice Activity Detection
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's SimpleEnergyVADService.swift
|
|
6
|
+
* Swift Source: Sources/RunAnywhere/Features/VAD/Services/SimpleEnergyVADService.swift
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: This is a direct translation of the Swift implementation.
|
|
9
|
+
* Do NOT add features not present in the Swift code.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef RAC_VAD_ENERGY_H
|
|
13
|
+
#define RAC_VAD_ENERGY_H
|
|
14
|
+
|
|
15
|
+
#include <RACommons/rac_error.h>
|
|
16
|
+
#include <RACommons/rac_types.h>
|
|
17
|
+
#include <RACommons/rac_vad_types.h>
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// CONSTANTS - Mirrors Swift's VADConstants
|
|
25
|
+
// NOTE: Core constants (RAC_VAD_DEFAULT_SAMPLE_RATE, RAC_VAD_DEFAULT_FRAME_LENGTH,
|
|
26
|
+
// RAC_VAD_DEFAULT_ENERGY_THRESHOLD, RAC_VAD_DEFAULT_CALIBRATION_MULTIPLIER)
|
|
27
|
+
// are defined in rac_vad_types.h
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
/** Frames of voice needed to start speech (normal mode) */
|
|
31
|
+
#define RAC_VAD_VOICE_START_THRESHOLD 1
|
|
32
|
+
|
|
33
|
+
/** Frames of silence needed to end speech (normal mode) */
|
|
34
|
+
#define RAC_VAD_VOICE_END_THRESHOLD 12
|
|
35
|
+
|
|
36
|
+
/** Frames of voice needed during TTS (prevents feedback) */
|
|
37
|
+
#define RAC_VAD_TTS_VOICE_START_THRESHOLD 10
|
|
38
|
+
|
|
39
|
+
/** Frames of silence needed during TTS */
|
|
40
|
+
#define RAC_VAD_TTS_VOICE_END_THRESHOLD 5
|
|
41
|
+
|
|
42
|
+
/** Number of calibration frames needed (~2 seconds at 100ms) */
|
|
43
|
+
#define RAC_VAD_CALIBRATION_FRAMES_NEEDED 20
|
|
44
|
+
|
|
45
|
+
/** Default calibration multiplier */
|
|
46
|
+
#define RAC_VAD_DEFAULT_CALIBRATION_MULTIPLIER 2.0f
|
|
47
|
+
|
|
48
|
+
/** Default TTS threshold multiplier */
|
|
49
|
+
#define RAC_VAD_DEFAULT_TTS_THRESHOLD_MULTIPLIER 3.0f
|
|
50
|
+
|
|
51
|
+
/** Maximum threshold cap */
|
|
52
|
+
#define RAC_VAD_MAX_THRESHOLD 0.020f
|
|
53
|
+
|
|
54
|
+
/** Minimum threshold */
|
|
55
|
+
#define RAC_VAD_MIN_THRESHOLD 0.003f
|
|
56
|
+
|
|
57
|
+
/** Maximum recent values for statistics */
|
|
58
|
+
#define RAC_VAD_MAX_RECENT_VALUES 50
|
|
59
|
+
|
|
60
|
+
// =============================================================================
|
|
61
|
+
// TYPES
|
|
62
|
+
// =============================================================================
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @brief Opaque handle for energy VAD service.
|
|
66
|
+
*/
|
|
67
|
+
typedef struct rac_energy_vad* rac_energy_vad_handle_t;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @brief Speech activity event types.
|
|
71
|
+
* Mirrors Swift's SpeechActivityEvent enum.
|
|
72
|
+
*/
|
|
73
|
+
typedef enum rac_speech_activity_event {
|
|
74
|
+
RAC_SPEECH_ACTIVITY_STARTED = 0, /**< Speech has started */
|
|
75
|
+
RAC_SPEECH_ACTIVITY_ENDED = 1 /**< Speech has ended */
|
|
76
|
+
} rac_speech_activity_event_t;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @brief Configuration for energy VAD.
|
|
80
|
+
* Mirrors Swift's SimpleEnergyVADService init parameters.
|
|
81
|
+
*/
|
|
82
|
+
typedef struct rac_energy_vad_config {
|
|
83
|
+
/** Audio sample rate (default: 16000) */
|
|
84
|
+
int32_t sample_rate;
|
|
85
|
+
|
|
86
|
+
/** Frame length in seconds (default: 0.1 = 100ms) */
|
|
87
|
+
float frame_length;
|
|
88
|
+
|
|
89
|
+
/** Energy threshold for voice detection (default: 0.005) */
|
|
90
|
+
float energy_threshold;
|
|
91
|
+
} rac_energy_vad_config_t;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @brief Default energy VAD configuration.
|
|
95
|
+
*/
|
|
96
|
+
static const rac_energy_vad_config_t RAC_ENERGY_VAD_CONFIG_DEFAULT = {
|
|
97
|
+
.sample_rate = RAC_VAD_DEFAULT_SAMPLE_RATE,
|
|
98
|
+
.frame_length = RAC_VAD_DEFAULT_FRAME_LENGTH,
|
|
99
|
+
.energy_threshold = RAC_VAD_DEFAULT_ENERGY_THRESHOLD};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @brief Energy VAD statistics for debugging.
|
|
103
|
+
* Mirrors Swift's SimpleEnergyVADService.getStatistics().
|
|
104
|
+
* Note: This is separate from rac_vad_statistics_t in rac_vad_types.h
|
|
105
|
+
*/
|
|
106
|
+
typedef struct rac_energy_vad_stats {
|
|
107
|
+
/** Current energy value */
|
|
108
|
+
float current;
|
|
109
|
+
|
|
110
|
+
/** Current threshold value */
|
|
111
|
+
float threshold;
|
|
112
|
+
|
|
113
|
+
/** Ambient noise level from calibration */
|
|
114
|
+
float ambient;
|
|
115
|
+
|
|
116
|
+
/** Recent average energy */
|
|
117
|
+
float recent_avg;
|
|
118
|
+
|
|
119
|
+
/** Recent maximum energy */
|
|
120
|
+
float recent_max;
|
|
121
|
+
} rac_energy_vad_stats_t;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @brief Callback for speech activity events.
|
|
125
|
+
* Mirrors Swift's onSpeechActivity callback.
|
|
126
|
+
*
|
|
127
|
+
* @param event The speech activity event type
|
|
128
|
+
* @param user_data User-provided context
|
|
129
|
+
*/
|
|
130
|
+
typedef void (*rac_speech_activity_callback_fn)(rac_speech_activity_event_t event, void* user_data);
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @brief Callback for processed audio buffers.
|
|
134
|
+
* Mirrors Swift's onAudioBuffer callback.
|
|
135
|
+
*
|
|
136
|
+
* @param audio_data Audio data buffer
|
|
137
|
+
* @param audio_size Size of audio data in bytes
|
|
138
|
+
* @param user_data User-provided context
|
|
139
|
+
*/
|
|
140
|
+
typedef void (*rac_audio_buffer_callback_fn)(const void* audio_data, size_t audio_size,
|
|
141
|
+
void* user_data);
|
|
142
|
+
|
|
143
|
+
// =============================================================================
|
|
144
|
+
// LIFECYCLE API - Mirrors Swift's VADService protocol
|
|
145
|
+
// =============================================================================
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @brief Create an energy VAD service.
|
|
149
|
+
*
|
|
150
|
+
* Mirrors Swift's SimpleEnergyVADService init.
|
|
151
|
+
*
|
|
152
|
+
* @param config Configuration (can be NULL for defaults)
|
|
153
|
+
* @param out_handle Output: Handle to the created service
|
|
154
|
+
* @return RAC_SUCCESS or error code
|
|
155
|
+
*/
|
|
156
|
+
RAC_API rac_result_t rac_energy_vad_create(const rac_energy_vad_config_t* config,
|
|
157
|
+
rac_energy_vad_handle_t* out_handle);
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @brief Destroy an energy VAD service.
|
|
161
|
+
*
|
|
162
|
+
* @param handle Service handle to destroy
|
|
163
|
+
*/
|
|
164
|
+
RAC_API void rac_energy_vad_destroy(rac_energy_vad_handle_t handle);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @brief Initialize the VAD service.
|
|
168
|
+
*
|
|
169
|
+
* Mirrors Swift's VADService.initialize().
|
|
170
|
+
* This starts the service and begins calibration.
|
|
171
|
+
*
|
|
172
|
+
* @param handle Service handle
|
|
173
|
+
* @return RAC_SUCCESS or error code
|
|
174
|
+
*/
|
|
175
|
+
RAC_API rac_result_t rac_energy_vad_initialize(rac_energy_vad_handle_t handle);
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @brief Start voice activity detection.
|
|
179
|
+
*
|
|
180
|
+
* Mirrors Swift's SimpleEnergyVADService.start().
|
|
181
|
+
*
|
|
182
|
+
* @param handle Service handle
|
|
183
|
+
* @return RAC_SUCCESS or error code
|
|
184
|
+
*/
|
|
185
|
+
RAC_API rac_result_t rac_energy_vad_start(rac_energy_vad_handle_t handle);
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @brief Stop voice activity detection.
|
|
189
|
+
*
|
|
190
|
+
* Mirrors Swift's SimpleEnergyVADService.stop().
|
|
191
|
+
*
|
|
192
|
+
* @param handle Service handle
|
|
193
|
+
* @return RAC_SUCCESS or error code
|
|
194
|
+
*/
|
|
195
|
+
RAC_API rac_result_t rac_energy_vad_stop(rac_energy_vad_handle_t handle);
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @brief Reset the VAD state.
|
|
199
|
+
*
|
|
200
|
+
* Mirrors Swift's VADService.reset().
|
|
201
|
+
*
|
|
202
|
+
* @param handle Service handle
|
|
203
|
+
* @return RAC_SUCCESS or error code
|
|
204
|
+
*/
|
|
205
|
+
RAC_API rac_result_t rac_energy_vad_reset(rac_energy_vad_handle_t handle);
|
|
206
|
+
|
|
207
|
+
// =============================================================================
|
|
208
|
+
// PROCESSING API
|
|
209
|
+
// =============================================================================
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @brief Process raw audio data for voice activity detection.
|
|
213
|
+
*
|
|
214
|
+
* Mirrors Swift's SimpleEnergyVADService.processAudioData(_:).
|
|
215
|
+
*
|
|
216
|
+
* @param handle Service handle
|
|
217
|
+
* @param audio_data Array of audio samples (float32)
|
|
218
|
+
* @param sample_count Number of samples
|
|
219
|
+
* @param out_has_voice Output: Whether voice was detected
|
|
220
|
+
* @return RAC_SUCCESS or error code
|
|
221
|
+
*/
|
|
222
|
+
RAC_API rac_result_t rac_energy_vad_process_audio(rac_energy_vad_handle_t handle,
|
|
223
|
+
const float* audio_data, size_t sample_count,
|
|
224
|
+
rac_bool_t* out_has_voice);
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @brief Calculate RMS energy of an audio signal.
|
|
228
|
+
*
|
|
229
|
+
* Mirrors Swift's calculateAverageEnergy(of:) using vDSP_rmsqv.
|
|
230
|
+
*
|
|
231
|
+
* @param audio_data Array of audio samples (float32)
|
|
232
|
+
* @param sample_count Number of samples
|
|
233
|
+
* @return RMS energy value, or 0.0 if empty
|
|
234
|
+
*/
|
|
235
|
+
RAC_API float rac_energy_vad_calculate_rms(const float* audio_data, size_t sample_count);
|
|
236
|
+
|
|
237
|
+
// =============================================================================
|
|
238
|
+
// PAUSE/RESUME API
|
|
239
|
+
// =============================================================================
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @brief Pause VAD processing.
|
|
243
|
+
*
|
|
244
|
+
* Mirrors Swift's SimpleEnergyVADService.pause().
|
|
245
|
+
*
|
|
246
|
+
* @param handle Service handle
|
|
247
|
+
* @return RAC_SUCCESS or error code
|
|
248
|
+
*/
|
|
249
|
+
RAC_API rac_result_t rac_energy_vad_pause(rac_energy_vad_handle_t handle);
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @brief Resume VAD processing.
|
|
253
|
+
*
|
|
254
|
+
* Mirrors Swift's SimpleEnergyVADService.resume().
|
|
255
|
+
*
|
|
256
|
+
* @param handle Service handle
|
|
257
|
+
* @return RAC_SUCCESS or error code
|
|
258
|
+
*/
|
|
259
|
+
RAC_API rac_result_t rac_energy_vad_resume(rac_energy_vad_handle_t handle);
|
|
260
|
+
|
|
261
|
+
// =============================================================================
|
|
262
|
+
// CALIBRATION API
|
|
263
|
+
// =============================================================================
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @brief Start automatic calibration to determine ambient noise level.
|
|
267
|
+
*
|
|
268
|
+
* Mirrors Swift's SimpleEnergyVADService.startCalibration().
|
|
269
|
+
* Non-blocking; call rac_energy_vad_is_calibrating() to check status.
|
|
270
|
+
*
|
|
271
|
+
* @param handle Service handle
|
|
272
|
+
* @return RAC_SUCCESS or error code
|
|
273
|
+
*/
|
|
274
|
+
RAC_API rac_result_t rac_energy_vad_start_calibration(rac_energy_vad_handle_t handle);
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @brief Check if calibration is in progress.
|
|
278
|
+
*
|
|
279
|
+
* @param handle Service handle
|
|
280
|
+
* @param out_is_calibrating Output: RAC_TRUE if calibrating
|
|
281
|
+
* @return RAC_SUCCESS or error code
|
|
282
|
+
*/
|
|
283
|
+
RAC_API rac_result_t rac_energy_vad_is_calibrating(rac_energy_vad_handle_t handle,
|
|
284
|
+
rac_bool_t* out_is_calibrating);
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @brief Set calibration parameters.
|
|
288
|
+
*
|
|
289
|
+
* Mirrors Swift's setCalibrationParameters(multiplier:).
|
|
290
|
+
*
|
|
291
|
+
* @param handle Service handle
|
|
292
|
+
* @param multiplier Calibration multiplier (clamped to 1.5-4.0)
|
|
293
|
+
* @return RAC_SUCCESS or error code
|
|
294
|
+
*/
|
|
295
|
+
RAC_API rac_result_t rac_energy_vad_set_calibration_multiplier(rac_energy_vad_handle_t handle,
|
|
296
|
+
float multiplier);
|
|
297
|
+
|
|
298
|
+
// =============================================================================
|
|
299
|
+
// TTS FEEDBACK PREVENTION API
|
|
300
|
+
// =============================================================================
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @brief Notify VAD that TTS is about to start playing.
|
|
304
|
+
*
|
|
305
|
+
* Mirrors Swift's notifyTTSWillStart().
|
|
306
|
+
* Increases threshold to prevent TTS audio from triggering VAD.
|
|
307
|
+
*
|
|
308
|
+
* @param handle Service handle
|
|
309
|
+
* @return RAC_SUCCESS or error code
|
|
310
|
+
*/
|
|
311
|
+
RAC_API rac_result_t rac_energy_vad_notify_tts_start(rac_energy_vad_handle_t handle);
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @brief Notify VAD that TTS has finished playing.
|
|
315
|
+
*
|
|
316
|
+
* Mirrors Swift's notifyTTSDidFinish().
|
|
317
|
+
* Restores threshold to base value.
|
|
318
|
+
*
|
|
319
|
+
* @param handle Service handle
|
|
320
|
+
* @return RAC_SUCCESS or error code
|
|
321
|
+
*/
|
|
322
|
+
RAC_API rac_result_t rac_energy_vad_notify_tts_finish(rac_energy_vad_handle_t handle);
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @brief Set TTS threshold multiplier.
|
|
326
|
+
*
|
|
327
|
+
* Mirrors Swift's setTTSThresholdMultiplier(_:).
|
|
328
|
+
*
|
|
329
|
+
* @param handle Service handle
|
|
330
|
+
* @param multiplier TTS threshold multiplier (clamped to 2.0-5.0)
|
|
331
|
+
* @return RAC_SUCCESS or error code
|
|
332
|
+
*/
|
|
333
|
+
RAC_API rac_result_t rac_energy_vad_set_tts_multiplier(rac_energy_vad_handle_t handle,
|
|
334
|
+
float multiplier);
|
|
335
|
+
|
|
336
|
+
// =============================================================================
|
|
337
|
+
// STATE QUERY API
|
|
338
|
+
// =============================================================================
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* @brief Check if speech is currently active.
|
|
342
|
+
*
|
|
343
|
+
* Mirrors Swift's VADService.isSpeechActive property.
|
|
344
|
+
*
|
|
345
|
+
* @param handle Service handle
|
|
346
|
+
* @param out_is_active Output: RAC_TRUE if speech is active
|
|
347
|
+
* @return RAC_SUCCESS or error code
|
|
348
|
+
*/
|
|
349
|
+
RAC_API rac_result_t rac_energy_vad_is_speech_active(rac_energy_vad_handle_t handle,
|
|
350
|
+
rac_bool_t* out_is_active);
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @brief Get current energy threshold.
|
|
354
|
+
*
|
|
355
|
+
* @param handle Service handle
|
|
356
|
+
* @param out_threshold Output: Current threshold value
|
|
357
|
+
* @return RAC_SUCCESS or error code
|
|
358
|
+
*/
|
|
359
|
+
RAC_API rac_result_t rac_energy_vad_get_threshold(rac_energy_vad_handle_t handle,
|
|
360
|
+
float* out_threshold);
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @brief Set energy threshold.
|
|
364
|
+
*
|
|
365
|
+
* @param handle Service handle
|
|
366
|
+
* @param threshold New threshold value
|
|
367
|
+
* @return RAC_SUCCESS or error code
|
|
368
|
+
*/
|
|
369
|
+
RAC_API rac_result_t rac_energy_vad_set_threshold(rac_energy_vad_handle_t handle, float threshold);
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @brief Get VAD statistics for debugging.
|
|
373
|
+
*
|
|
374
|
+
* Mirrors Swift's getStatistics().
|
|
375
|
+
*
|
|
376
|
+
* @param handle Service handle
|
|
377
|
+
* @param out_stats Output: VAD statistics
|
|
378
|
+
* @return RAC_SUCCESS or error code
|
|
379
|
+
*/
|
|
380
|
+
RAC_API rac_result_t rac_energy_vad_get_statistics(rac_energy_vad_handle_t handle,
|
|
381
|
+
rac_energy_vad_stats_t* out_stats);
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @brief Get sample rate.
|
|
385
|
+
*
|
|
386
|
+
* Mirrors Swift's sampleRate property.
|
|
387
|
+
*
|
|
388
|
+
* @param handle Service handle
|
|
389
|
+
* @param out_sample_rate Output: Sample rate
|
|
390
|
+
* @return RAC_SUCCESS or error code
|
|
391
|
+
*/
|
|
392
|
+
RAC_API rac_result_t rac_energy_vad_get_sample_rate(rac_energy_vad_handle_t handle,
|
|
393
|
+
int32_t* out_sample_rate);
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @brief Get frame length in samples.
|
|
397
|
+
*
|
|
398
|
+
* Mirrors Swift's frameLengthSamples property.
|
|
399
|
+
*
|
|
400
|
+
* @param handle Service handle
|
|
401
|
+
* @param out_frame_length Output: Frame length in samples
|
|
402
|
+
* @return RAC_SUCCESS or error code
|
|
403
|
+
*/
|
|
404
|
+
RAC_API rac_result_t rac_energy_vad_get_frame_length_samples(rac_energy_vad_handle_t handle,
|
|
405
|
+
int32_t* out_frame_length);
|
|
406
|
+
|
|
407
|
+
// =============================================================================
|
|
408
|
+
// CALLBACK API
|
|
409
|
+
// =============================================================================
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @brief Set speech activity callback.
|
|
413
|
+
*
|
|
414
|
+
* Mirrors Swift's onSpeechActivity property.
|
|
415
|
+
*
|
|
416
|
+
* @param handle Service handle
|
|
417
|
+
* @param callback Callback function (can be NULL to clear)
|
|
418
|
+
* @param user_data User-provided context
|
|
419
|
+
* @return RAC_SUCCESS or error code
|
|
420
|
+
*/
|
|
421
|
+
RAC_API rac_result_t rac_energy_vad_set_speech_callback(rac_energy_vad_handle_t handle,
|
|
422
|
+
rac_speech_activity_callback_fn callback,
|
|
423
|
+
void* user_data);
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @brief Set audio buffer callback.
|
|
427
|
+
*
|
|
428
|
+
* Mirrors Swift's onAudioBuffer property.
|
|
429
|
+
*
|
|
430
|
+
* @param handle Service handle
|
|
431
|
+
* @param callback Callback function (can be NULL to clear)
|
|
432
|
+
* @param user_data User-provided context
|
|
433
|
+
* @return RAC_SUCCESS or error code
|
|
434
|
+
*/
|
|
435
|
+
RAC_API rac_result_t rac_energy_vad_set_audio_callback(rac_energy_vad_handle_t handle,
|
|
436
|
+
rac_audio_buffer_callback_fn callback,
|
|
437
|
+
void* user_data);
|
|
438
|
+
|
|
439
|
+
#ifdef __cplusplus
|
|
440
|
+
}
|
|
441
|
+
#endif
|
|
442
|
+
|
|
443
|
+
#endif /* RAC_VAD_ENERGY_H */
|
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_events.h
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_events.h
|
|
3
|
+
* @brief VAD-specific event types - 1:1 port of VADEvent.swift
|
|
4
|
+
*
|
|
5
|
+
* Swift Source: Sources/RunAnywhere/Features/VAD/Analytics/VADEvent.swift
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef RAC_VAD_EVENTS_H
|
|
9
|
+
#define RAC_VAD_EVENTS_H
|
|
10
|
+
|
|
11
|
+
#include <RACommons/rac_types.h>
|
|
12
|
+
#include <RACommons/rac_events.h>
|
|
13
|
+
|
|
14
|
+
#ifdef __cplusplus
|
|
15
|
+
extern "C" {
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// VAD EVENT TYPES
|
|
20
|
+
// =============================================================================
|
|
21
|
+
|
|
22
|
+
typedef enum rac_vad_event_type {
|
|
23
|
+
RAC_VAD_EVENT_INITIALIZED = 0,
|
|
24
|
+
RAC_VAD_EVENT_INITIALIZATION_FAILED,
|
|
25
|
+
RAC_VAD_EVENT_CLEANED_UP,
|
|
26
|
+
RAC_VAD_EVENT_STARTED,
|
|
27
|
+
RAC_VAD_EVENT_STOPPED,
|
|
28
|
+
RAC_VAD_EVENT_SPEECH_STARTED,
|
|
29
|
+
RAC_VAD_EVENT_SPEECH_ENDED,
|
|
30
|
+
RAC_VAD_EVENT_PAUSED,
|
|
31
|
+
RAC_VAD_EVENT_RESUMED,
|
|
32
|
+
RAC_VAD_EVENT_MODEL_LOAD_STARTED,
|
|
33
|
+
RAC_VAD_EVENT_MODEL_LOAD_COMPLETED,
|
|
34
|
+
RAC_VAD_EVENT_MODEL_LOAD_FAILED,
|
|
35
|
+
RAC_VAD_EVENT_MODEL_UNLOADED,
|
|
36
|
+
} rac_vad_event_type_t;
|
|
37
|
+
|
|
38
|
+
// =============================================================================
|
|
39
|
+
// EVENT PUBLISHING FUNCTIONS
|
|
40
|
+
// =============================================================================
|
|
41
|
+
|
|
42
|
+
RAC_API rac_result_t rac_vad_event_initialized(rac_inference_framework_t framework);
|
|
43
|
+
|
|
44
|
+
RAC_API rac_result_t rac_vad_event_initialization_failed(rac_result_t error_code,
|
|
45
|
+
const char* error_message,
|
|
46
|
+
rac_inference_framework_t framework);
|
|
47
|
+
|
|
48
|
+
RAC_API rac_result_t rac_vad_event_cleaned_up(void);
|
|
49
|
+
RAC_API rac_result_t rac_vad_event_started(void);
|
|
50
|
+
RAC_API rac_result_t rac_vad_event_stopped(void);
|
|
51
|
+
RAC_API rac_result_t rac_vad_event_speech_started(void);
|
|
52
|
+
RAC_API rac_result_t rac_vad_event_speech_ended(double duration_ms);
|
|
53
|
+
RAC_API rac_result_t rac_vad_event_paused(void);
|
|
54
|
+
RAC_API rac_result_t rac_vad_event_resumed(void);
|
|
55
|
+
|
|
56
|
+
RAC_API rac_result_t rac_vad_event_model_load_started(const char* model_id,
|
|
57
|
+
int64_t model_size_bytes,
|
|
58
|
+
rac_inference_framework_t framework);
|
|
59
|
+
|
|
60
|
+
RAC_API rac_result_t rac_vad_event_model_load_completed(const char* model_id, double duration_ms,
|
|
61
|
+
int64_t model_size_bytes,
|
|
62
|
+
rac_inference_framework_t framework);
|
|
63
|
+
|
|
64
|
+
RAC_API rac_result_t rac_vad_event_model_load_failed(const char* model_id, rac_result_t error_code,
|
|
65
|
+
const char* error_message,
|
|
66
|
+
rac_inference_framework_t framework);
|
|
67
|
+
|
|
68
|
+
RAC_API rac_result_t rac_vad_event_model_unloaded(const char* model_id);
|
|
69
|
+
|
|
70
|
+
RAC_API const char* rac_vad_event_type_string(rac_vad_event_type_t event_type);
|
|
71
|
+
|
|
72
|
+
#ifdef __cplusplus
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
#endif /* RAC_VAD_EVENTS_H */
|
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/rac_vad_onnx.h
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_onnx.h
|
|
3
|
+
* @brief RunAnywhere Core - ONNX Backend RAC API for VAD
|
|
4
|
+
*
|
|
5
|
+
* Direct RAC API export from runanywhere-core's ONNX VAD backend.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef RAC_VAD_ONNX_H
|
|
9
|
+
#define RAC_VAD_ONNX_H
|
|
10
|
+
|
|
11
|
+
#include <RACommons/rac_error.h>
|
|
12
|
+
#include <RACommons/rac_types.h>
|
|
13
|
+
#include <RACommons/rac_vad.h>
|
|
14
|
+
|
|
15
|
+
#ifdef __cplusplus
|
|
16
|
+
extern "C" {
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// EXPORT MACRO
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
#if defined(RAC_ONNX_BUILDING)
|
|
24
|
+
#if defined(_WIN32)
|
|
25
|
+
#define RAC_ONNX_API __declspec(dllexport)
|
|
26
|
+
#elif defined(__GNUC__) || defined(__clang__)
|
|
27
|
+
#define RAC_ONNX_API __attribute__((visibility("default")))
|
|
28
|
+
#else
|
|
29
|
+
#define RAC_ONNX_API
|
|
30
|
+
#endif
|
|
31
|
+
#else
|
|
32
|
+
#define RAC_ONNX_API
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// CONFIGURATION
|
|
37
|
+
// =============================================================================
|
|
38
|
+
|
|
39
|
+
typedef struct rac_vad_onnx_config {
|
|
40
|
+
int32_t sample_rate;
|
|
41
|
+
float energy_threshold;
|
|
42
|
+
float frame_length;
|
|
43
|
+
int32_t num_threads;
|
|
44
|
+
} rac_vad_onnx_config_t;
|
|
45
|
+
|
|
46
|
+
static const rac_vad_onnx_config_t RAC_VAD_ONNX_CONFIG_DEFAULT = {
|
|
47
|
+
.sample_rate = 16000, .energy_threshold = 0.5f, .frame_length = 0.032f, .num_threads = 0};
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// ONNX VAD API
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_create(const char* model_path,
|
|
54
|
+
const rac_vad_onnx_config_t* config,
|
|
55
|
+
rac_handle_t* out_handle);
|
|
56
|
+
|
|
57
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_process(rac_handle_t handle, const float* samples,
|
|
58
|
+
size_t num_samples, rac_bool_t* out_is_speech);
|
|
59
|
+
|
|
60
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_start(rac_handle_t handle);
|
|
61
|
+
|
|
62
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_stop(rac_handle_t handle);
|
|
63
|
+
|
|
64
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_reset(rac_handle_t handle);
|
|
65
|
+
|
|
66
|
+
RAC_ONNX_API rac_result_t rac_vad_onnx_set_threshold(rac_handle_t handle, float threshold);
|
|
67
|
+
|
|
68
|
+
RAC_ONNX_API rac_bool_t rac_vad_onnx_is_speech_active(rac_handle_t handle);
|
|
69
|
+
|
|
70
|
+
RAC_ONNX_API void rac_vad_onnx_destroy(rac_handle_t handle);
|
|
71
|
+
|
|
72
|
+
// =============================================================================
|
|
73
|
+
// BACKEND REGISTRATION
|
|
74
|
+
// =============================================================================
|
|
75
|
+
|
|
76
|
+
RAC_ONNX_API rac_result_t rac_backend_onnx_register(void);
|
|
77
|
+
|
|
78
|
+
RAC_ONNX_API rac_result_t rac_backend_onnx_unregister(void);
|
|
79
|
+
|
|
80
|
+
#ifdef __cplusplus
|
|
81
|
+
}
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#endif /* RAC_VAD_ONNX_H */
|