@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,374 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_tts_types.h
|
|
3
|
+
* @brief RunAnywhere Commons - TTS Types and Data Structures
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's TTS Models from:
|
|
6
|
+
* Sources/RunAnywhere/Features/TTS/Models/TTSConfiguration.swift
|
|
7
|
+
* Sources/RunAnywhere/Features/TTS/Models/TTSOptions.swift
|
|
8
|
+
* Sources/RunAnywhere/Features/TTS/Models/TTSInput.swift
|
|
9
|
+
* Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
|
|
10
|
+
*
|
|
11
|
+
* This header defines data structures only. For the service interface,
|
|
12
|
+
* see rac_tts_service.h.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#ifndef RAC_TTS_TYPES_H
|
|
16
|
+
#define RAC_TTS_TYPES_H
|
|
17
|
+
|
|
18
|
+
#include "rac/core/rac_types.h"
|
|
19
|
+
#include "rac/features/stt/rac_stt_types.h" // For rac_audio_format_enum_t
|
|
20
|
+
|
|
21
|
+
#ifdef __cplusplus
|
|
22
|
+
extern "C" {
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// CONSTANTS - Single Source of Truth for TTS
|
|
27
|
+
// Swift references these via CRACommons import
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
// Audio Format Constants
|
|
31
|
+
#define RAC_TTS_DEFAULT_SAMPLE_RATE 22050
|
|
32
|
+
#define RAC_TTS_HIGH_QUALITY_SAMPLE_RATE 24000
|
|
33
|
+
#define RAC_TTS_CD_QUALITY_SAMPLE_RATE 44100
|
|
34
|
+
#define RAC_TTS_MAX_SAMPLE_RATE 48000
|
|
35
|
+
#define RAC_TTS_BYTES_PER_SAMPLE 2
|
|
36
|
+
#define RAC_TTS_CHANNELS 1
|
|
37
|
+
|
|
38
|
+
// Speaking Rate Constants
|
|
39
|
+
#define RAC_TTS_DEFAULT_SPEAKING_RATE 1.0f
|
|
40
|
+
#define RAC_TTS_MIN_SPEAKING_RATE 0.5f
|
|
41
|
+
#define RAC_TTS_MAX_SPEAKING_RATE 2.0f
|
|
42
|
+
|
|
43
|
+
// Streaming Constants
|
|
44
|
+
#define RAC_TTS_DEFAULT_STREAMING_CHUNK_BYTES 4096
|
|
45
|
+
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// CONFIGURATION - Mirrors Swift's TTSConfiguration
|
|
48
|
+
// =============================================================================
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @brief TTS component configuration
|
|
52
|
+
*
|
|
53
|
+
* Mirrors Swift's TTSConfiguration struct exactly.
|
|
54
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSConfiguration.swift
|
|
55
|
+
*/
|
|
56
|
+
typedef struct rac_tts_config {
|
|
57
|
+
/** Model ID (voice identifier for TTS, optional) */
|
|
58
|
+
const char* model_id;
|
|
59
|
+
|
|
60
|
+
/** Preferred framework (use -1 for auto) */
|
|
61
|
+
int32_t preferred_framework;
|
|
62
|
+
|
|
63
|
+
/** Voice identifier to use for synthesis */
|
|
64
|
+
const char* voice;
|
|
65
|
+
|
|
66
|
+
/** Language for synthesis (BCP-47 format, e.g., "en-US") */
|
|
67
|
+
const char* language;
|
|
68
|
+
|
|
69
|
+
/** Speaking rate (0.5 to 2.0, 1.0 is normal) */
|
|
70
|
+
float speaking_rate;
|
|
71
|
+
|
|
72
|
+
/** Speech pitch (0.5 to 2.0, 1.0 is normal) */
|
|
73
|
+
float pitch;
|
|
74
|
+
|
|
75
|
+
/** Speech volume (0.0 to 1.0) */
|
|
76
|
+
float volume;
|
|
77
|
+
|
|
78
|
+
/** Audio format for output */
|
|
79
|
+
rac_audio_format_enum_t audio_format;
|
|
80
|
+
|
|
81
|
+
/** Whether to use neural/premium voice if available */
|
|
82
|
+
rac_bool_t use_neural_voice;
|
|
83
|
+
|
|
84
|
+
/** Whether to enable SSML markup support */
|
|
85
|
+
rac_bool_t enable_ssml;
|
|
86
|
+
} rac_tts_config_t;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @brief Default TTS configuration
|
|
90
|
+
*/
|
|
91
|
+
static const rac_tts_config_t RAC_TTS_CONFIG_DEFAULT = {.model_id = RAC_NULL,
|
|
92
|
+
.preferred_framework = -1,
|
|
93
|
+
.voice = RAC_NULL,
|
|
94
|
+
.language = "en-US",
|
|
95
|
+
.speaking_rate = 1.0f,
|
|
96
|
+
.pitch = 1.0f,
|
|
97
|
+
.volume = 1.0f,
|
|
98
|
+
.audio_format = RAC_AUDIO_FORMAT_PCM,
|
|
99
|
+
.use_neural_voice = RAC_TRUE,
|
|
100
|
+
.enable_ssml = RAC_FALSE};
|
|
101
|
+
|
|
102
|
+
// =============================================================================
|
|
103
|
+
// OPTIONS - Mirrors Swift's TTSOptions
|
|
104
|
+
// =============================================================================
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @brief TTS synthesis options
|
|
108
|
+
*
|
|
109
|
+
* Mirrors Swift's TTSOptions struct exactly.
|
|
110
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSOptions.swift
|
|
111
|
+
*/
|
|
112
|
+
typedef struct rac_tts_options {
|
|
113
|
+
/** Voice to use for synthesis (can be NULL for default) */
|
|
114
|
+
const char* voice;
|
|
115
|
+
|
|
116
|
+
/** Language for synthesis (BCP-47 format, e.g., "en-US") */
|
|
117
|
+
const char* language;
|
|
118
|
+
|
|
119
|
+
/** Speech rate (0.0 to 2.0, 1.0 is normal) */
|
|
120
|
+
float rate;
|
|
121
|
+
|
|
122
|
+
/** Speech pitch (0.0 to 2.0, 1.0 is normal) */
|
|
123
|
+
float pitch;
|
|
124
|
+
|
|
125
|
+
/** Speech volume (0.0 to 1.0) */
|
|
126
|
+
float volume;
|
|
127
|
+
|
|
128
|
+
/** Audio format for output */
|
|
129
|
+
rac_audio_format_enum_t audio_format;
|
|
130
|
+
|
|
131
|
+
/** Sample rate for output audio in Hz */
|
|
132
|
+
int32_t sample_rate;
|
|
133
|
+
|
|
134
|
+
/** Whether to use SSML markup */
|
|
135
|
+
rac_bool_t use_ssml;
|
|
136
|
+
} rac_tts_options_t;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @brief Default TTS options
|
|
140
|
+
*/
|
|
141
|
+
static const rac_tts_options_t RAC_TTS_OPTIONS_DEFAULT = {.voice = RAC_NULL,
|
|
142
|
+
.language = "en-US",
|
|
143
|
+
.rate = 1.0f,
|
|
144
|
+
.pitch = 1.0f,
|
|
145
|
+
.volume = 1.0f,
|
|
146
|
+
.audio_format = RAC_AUDIO_FORMAT_PCM,
|
|
147
|
+
.sample_rate =
|
|
148
|
+
RAC_TTS_DEFAULT_SAMPLE_RATE,
|
|
149
|
+
.use_ssml = RAC_FALSE};
|
|
150
|
+
|
|
151
|
+
// =============================================================================
|
|
152
|
+
// INPUT - Mirrors Swift's TTSInput
|
|
153
|
+
// =============================================================================
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @brief TTS input data
|
|
157
|
+
*
|
|
158
|
+
* Mirrors Swift's TTSInput struct exactly.
|
|
159
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSInput.swift
|
|
160
|
+
*/
|
|
161
|
+
typedef struct rac_tts_input {
|
|
162
|
+
/** Text to synthesize */
|
|
163
|
+
const char* text;
|
|
164
|
+
|
|
165
|
+
/** Optional SSML markup (overrides text if provided, can be NULL) */
|
|
166
|
+
const char* ssml;
|
|
167
|
+
|
|
168
|
+
/** Voice ID override (can be NULL) */
|
|
169
|
+
const char* voice_id;
|
|
170
|
+
|
|
171
|
+
/** Language override (can be NULL) */
|
|
172
|
+
const char* language;
|
|
173
|
+
|
|
174
|
+
/** Custom options override (can be NULL) */
|
|
175
|
+
const rac_tts_options_t* options;
|
|
176
|
+
} rac_tts_input_t;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @brief Default TTS input
|
|
180
|
+
*/
|
|
181
|
+
static const rac_tts_input_t RAC_TTS_INPUT_DEFAULT = {.text = RAC_NULL,
|
|
182
|
+
.ssml = RAC_NULL,
|
|
183
|
+
.voice_id = RAC_NULL,
|
|
184
|
+
.language = RAC_NULL,
|
|
185
|
+
.options = RAC_NULL};
|
|
186
|
+
|
|
187
|
+
// =============================================================================
|
|
188
|
+
// RESULT - Mirrors Swift's TTS result
|
|
189
|
+
// =============================================================================
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @brief TTS synthesis result
|
|
193
|
+
*/
|
|
194
|
+
typedef struct rac_tts_result {
|
|
195
|
+
/** Audio data (owned, must be freed with rac_free) */
|
|
196
|
+
void* audio_data;
|
|
197
|
+
|
|
198
|
+
/** Size of audio data in bytes */
|
|
199
|
+
size_t audio_size;
|
|
200
|
+
|
|
201
|
+
/** Audio format */
|
|
202
|
+
rac_audio_format_enum_t audio_format;
|
|
203
|
+
|
|
204
|
+
/** Sample rate */
|
|
205
|
+
int32_t sample_rate;
|
|
206
|
+
|
|
207
|
+
/** Duration in milliseconds */
|
|
208
|
+
int64_t duration_ms;
|
|
209
|
+
|
|
210
|
+
/** Processing time in milliseconds */
|
|
211
|
+
int64_t processing_time_ms;
|
|
212
|
+
} rac_tts_result_t;
|
|
213
|
+
|
|
214
|
+
// =============================================================================
|
|
215
|
+
// INFO - Mirrors Swift's TTSService properties
|
|
216
|
+
// =============================================================================
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @brief TTS service info
|
|
220
|
+
*/
|
|
221
|
+
typedef struct rac_tts_info {
|
|
222
|
+
/** Whether the service is ready */
|
|
223
|
+
rac_bool_t is_ready;
|
|
224
|
+
|
|
225
|
+
/** Whether currently synthesizing */
|
|
226
|
+
rac_bool_t is_synthesizing;
|
|
227
|
+
|
|
228
|
+
/** Available voices (null-terminated array) */
|
|
229
|
+
const char* const* available_voices;
|
|
230
|
+
size_t num_voices;
|
|
231
|
+
} rac_tts_info_t;
|
|
232
|
+
|
|
233
|
+
// =============================================================================
|
|
234
|
+
// CALLBACKS
|
|
235
|
+
// =============================================================================
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @brief TTS streaming callback
|
|
239
|
+
*
|
|
240
|
+
* Called for each audio chunk during streaming synthesis.
|
|
241
|
+
*
|
|
242
|
+
* @param audio_data Audio chunk data
|
|
243
|
+
* @param audio_size Size of audio chunk
|
|
244
|
+
* @param user_data User-provided context
|
|
245
|
+
*/
|
|
246
|
+
typedef void (*rac_tts_stream_callback_t)(const void* audio_data, size_t audio_size,
|
|
247
|
+
void* user_data);
|
|
248
|
+
|
|
249
|
+
// =============================================================================
|
|
250
|
+
// PHONEME TIMESTAMP - Mirrors Swift's TTSPhonemeTimestamp
|
|
251
|
+
// =============================================================================
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @brief Phoneme timestamp information
|
|
255
|
+
*
|
|
256
|
+
* Mirrors Swift's TTSPhonemeTimestamp struct.
|
|
257
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
|
|
258
|
+
*/
|
|
259
|
+
typedef struct rac_tts_phoneme_timestamp {
|
|
260
|
+
/** The phoneme */
|
|
261
|
+
const char* phoneme;
|
|
262
|
+
|
|
263
|
+
/** Start time in milliseconds */
|
|
264
|
+
int64_t start_time_ms;
|
|
265
|
+
|
|
266
|
+
/** End time in milliseconds */
|
|
267
|
+
int64_t end_time_ms;
|
|
268
|
+
} rac_tts_phoneme_timestamp_t;
|
|
269
|
+
|
|
270
|
+
// =============================================================================
|
|
271
|
+
// SYNTHESIS METADATA - Mirrors Swift's TTSSynthesisMetadata
|
|
272
|
+
// =============================================================================
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @brief Synthesis metadata
|
|
276
|
+
*
|
|
277
|
+
* Mirrors Swift's TTSSynthesisMetadata struct.
|
|
278
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
|
|
279
|
+
*/
|
|
280
|
+
typedef struct rac_tts_synthesis_metadata {
|
|
281
|
+
/** Voice used for synthesis */
|
|
282
|
+
const char* voice;
|
|
283
|
+
|
|
284
|
+
/** Language used for synthesis */
|
|
285
|
+
const char* language;
|
|
286
|
+
|
|
287
|
+
/** Processing time in milliseconds */
|
|
288
|
+
int64_t processing_time_ms;
|
|
289
|
+
|
|
290
|
+
/** Number of characters synthesized */
|
|
291
|
+
int32_t character_count;
|
|
292
|
+
|
|
293
|
+
/** Characters processed per second */
|
|
294
|
+
float characters_per_second;
|
|
295
|
+
} rac_tts_synthesis_metadata_t;
|
|
296
|
+
|
|
297
|
+
// =============================================================================
|
|
298
|
+
// OUTPUT - Mirrors Swift's TTSOutput
|
|
299
|
+
// =============================================================================
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @brief TTS output data
|
|
303
|
+
*
|
|
304
|
+
* Mirrors Swift's TTSOutput struct exactly.
|
|
305
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
|
|
306
|
+
*/
|
|
307
|
+
typedef struct rac_tts_output {
|
|
308
|
+
/** Synthesized audio data (owned, must be freed with rac_free) */
|
|
309
|
+
void* audio_data;
|
|
310
|
+
|
|
311
|
+
/** Size of audio data in bytes */
|
|
312
|
+
size_t audio_size;
|
|
313
|
+
|
|
314
|
+
/** Audio format of the output */
|
|
315
|
+
rac_audio_format_enum_t format;
|
|
316
|
+
|
|
317
|
+
/** Duration of the audio in milliseconds */
|
|
318
|
+
int64_t duration_ms;
|
|
319
|
+
|
|
320
|
+
/** Phoneme timestamps if available (can be NULL) */
|
|
321
|
+
rac_tts_phoneme_timestamp_t* phoneme_timestamps;
|
|
322
|
+
size_t num_phoneme_timestamps;
|
|
323
|
+
|
|
324
|
+
/** Processing metadata */
|
|
325
|
+
rac_tts_synthesis_metadata_t metadata;
|
|
326
|
+
|
|
327
|
+
/** Timestamp in milliseconds since epoch */
|
|
328
|
+
int64_t timestamp_ms;
|
|
329
|
+
} rac_tts_output_t;
|
|
330
|
+
|
|
331
|
+
// =============================================================================
|
|
332
|
+
// SPEAK RESULT - Mirrors Swift's TTSSpeakResult
|
|
333
|
+
// =============================================================================
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @brief Speak result (metadata only, no audio data)
|
|
337
|
+
*
|
|
338
|
+
* Mirrors Swift's TTSSpeakResult struct.
|
|
339
|
+
* The SDK handles audio playback internally when using speak().
|
|
340
|
+
* See: Sources/RunAnywhere/Features/TTS/Models/TTSOutput.swift
|
|
341
|
+
*/
|
|
342
|
+
typedef struct rac_tts_speak_result {
|
|
343
|
+
/** Duration of the spoken audio in milliseconds */
|
|
344
|
+
int64_t duration_ms;
|
|
345
|
+
|
|
346
|
+
/** Audio format used */
|
|
347
|
+
rac_audio_format_enum_t format;
|
|
348
|
+
|
|
349
|
+
/** Audio size in bytes (0 for system TTS which plays directly) */
|
|
350
|
+
size_t audio_size_bytes;
|
|
351
|
+
|
|
352
|
+
/** Synthesis metadata */
|
|
353
|
+
rac_tts_synthesis_metadata_t metadata;
|
|
354
|
+
|
|
355
|
+
/** Timestamp when speech completed (milliseconds since epoch) */
|
|
356
|
+
int64_t timestamp_ms;
|
|
357
|
+
} rac_tts_speak_result_t;
|
|
358
|
+
|
|
359
|
+
// =============================================================================
|
|
360
|
+
// MEMORY MANAGEMENT
|
|
361
|
+
// =============================================================================
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* @brief Free TTS result resources
|
|
365
|
+
*
|
|
366
|
+
* @param result Result to free (can be NULL)
|
|
367
|
+
*/
|
|
368
|
+
RAC_API void rac_tts_result_free(rac_tts_result_t* result);
|
|
369
|
+
|
|
370
|
+
#ifdef __cplusplus
|
|
371
|
+
}
|
|
372
|
+
#endif
|
|
373
|
+
|
|
374
|
+
#endif /* RAC_TTS_TYPES_H */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad.h
|
|
3
|
+
* @brief RunAnywhere Commons - VAD API (Convenience Header)
|
|
4
|
+
*
|
|
5
|
+
* This header includes both types and service interface for convenience.
|
|
6
|
+
* For better separation of concerns, prefer including:
|
|
7
|
+
* - rac_vad_types.h for data structures only
|
|
8
|
+
* - rac_vad_service.h for the service interface
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef RAC_VAD_H
|
|
12
|
+
#define RAC_VAD_H
|
|
13
|
+
|
|
14
|
+
#include "rac/features/vad/rac_vad_service.h"
|
|
15
|
+
#include "rac/features/vad/rac_vad_types.h"
|
|
16
|
+
|
|
17
|
+
#endif /* RAC_VAD_H */
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_vad_analytics.h
|
|
3
|
+
* @brief VAD analytics service - 1:1 port of VADAnalyticsService.swift
|
|
4
|
+
*
|
|
5
|
+
* Tracks VAD operations and metrics.
|
|
6
|
+
*
|
|
7
|
+
* Swift Source: Sources/RunAnywhere/Features/VAD/Analytics/VADAnalyticsService.swift
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#ifndef RAC_VAD_ANALYTICS_H
|
|
11
|
+
#define RAC_VAD_ANALYTICS_H
|
|
12
|
+
|
|
13
|
+
#include "rac/core/rac_types.h"
|
|
14
|
+
#include "rac/features/vad/rac_vad_types.h"
|
|
15
|
+
#include "rac/infrastructure/model_management/rac_model_types.h"
|
|
16
|
+
|
|
17
|
+
#ifdef __cplusplus
|
|
18
|
+
extern "C" {
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// TYPES
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @brief Opaque handle for VAD analytics service
|
|
27
|
+
*/
|
|
28
|
+
typedef struct rac_vad_analytics_s* rac_vad_analytics_handle_t;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @brief VAD metrics structure
|
|
32
|
+
* Mirrors Swift's VADMetrics struct
|
|
33
|
+
*/
|
|
34
|
+
typedef struct rac_vad_metrics {
|
|
35
|
+
/** Total number of events tracked */
|
|
36
|
+
int32_t total_events;
|
|
37
|
+
|
|
38
|
+
/** Start time (milliseconds since epoch) */
|
|
39
|
+
int64_t start_time_ms;
|
|
40
|
+
|
|
41
|
+
/** Last event time (milliseconds since epoch, 0 if no events) */
|
|
42
|
+
int64_t last_event_time_ms;
|
|
43
|
+
|
|
44
|
+
/** Total number of speech segments detected */
|
|
45
|
+
int32_t total_speech_segments;
|
|
46
|
+
|
|
47
|
+
/** Total speech duration in milliseconds */
|
|
48
|
+
double total_speech_duration_ms;
|
|
49
|
+
|
|
50
|
+
/** Average speech duration in milliseconds (-1 if no segments) */
|
|
51
|
+
double average_speech_duration_ms;
|
|
52
|
+
|
|
53
|
+
/** Current framework being used */
|
|
54
|
+
rac_inference_framework_t framework;
|
|
55
|
+
} rac_vad_metrics_t;
|
|
56
|
+
|
|
57
|
+
// =============================================================================
|
|
58
|
+
// LIFECYCLE
|
|
59
|
+
// =============================================================================
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @brief Create a VAD analytics service instance
|
|
63
|
+
*
|
|
64
|
+
* @param out_handle Output: Handle to the created service
|
|
65
|
+
* @return RAC_SUCCESS or error code
|
|
66
|
+
*/
|
|
67
|
+
RAC_API rac_result_t rac_vad_analytics_create(rac_vad_analytics_handle_t* out_handle);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @brief Destroy a VAD analytics service instance
|
|
71
|
+
*
|
|
72
|
+
* @param handle Handle to destroy
|
|
73
|
+
*/
|
|
74
|
+
RAC_API void rac_vad_analytics_destroy(rac_vad_analytics_handle_t handle);
|
|
75
|
+
|
|
76
|
+
// =============================================================================
|
|
77
|
+
// LIFECYCLE TRACKING
|
|
78
|
+
// =============================================================================
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @brief Track VAD initialization
|
|
82
|
+
*
|
|
83
|
+
* @param handle Analytics service handle
|
|
84
|
+
* @param framework The inference framework being used
|
|
85
|
+
* @return RAC_SUCCESS or error code
|
|
86
|
+
*/
|
|
87
|
+
RAC_API rac_result_t rac_vad_analytics_track_initialized(rac_vad_analytics_handle_t handle,
|
|
88
|
+
rac_inference_framework_t framework);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @brief Track VAD initialization failure
|
|
92
|
+
*
|
|
93
|
+
* @param handle Analytics service handle
|
|
94
|
+
* @param error_code Error code
|
|
95
|
+
* @param error_message Error message
|
|
96
|
+
* @param framework The inference framework
|
|
97
|
+
* @return RAC_SUCCESS or error code
|
|
98
|
+
*/
|
|
99
|
+
RAC_API rac_result_t rac_vad_analytics_track_initialization_failed(
|
|
100
|
+
rac_vad_analytics_handle_t handle, rac_result_t error_code, const char* error_message,
|
|
101
|
+
rac_inference_framework_t framework);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @brief Track VAD cleanup
|
|
105
|
+
*
|
|
106
|
+
* @param handle Analytics service handle
|
|
107
|
+
* @return RAC_SUCCESS or error code
|
|
108
|
+
*/
|
|
109
|
+
RAC_API rac_result_t rac_vad_analytics_track_cleaned_up(rac_vad_analytics_handle_t handle);
|
|
110
|
+
|
|
111
|
+
// =============================================================================
|
|
112
|
+
// DETECTION TRACKING
|
|
113
|
+
// =============================================================================
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @brief Track VAD started
|
|
117
|
+
*
|
|
118
|
+
* @param handle Analytics service handle
|
|
119
|
+
* @return RAC_SUCCESS or error code
|
|
120
|
+
*/
|
|
121
|
+
RAC_API rac_result_t rac_vad_analytics_track_started(rac_vad_analytics_handle_t handle);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @brief Track VAD stopped
|
|
125
|
+
*
|
|
126
|
+
* @param handle Analytics service handle
|
|
127
|
+
* @return RAC_SUCCESS or error code
|
|
128
|
+
*/
|
|
129
|
+
RAC_API rac_result_t rac_vad_analytics_track_stopped(rac_vad_analytics_handle_t handle);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @brief Track speech detected (start of speech/voice activity)
|
|
133
|
+
*
|
|
134
|
+
* @param handle Analytics service handle
|
|
135
|
+
* @return RAC_SUCCESS or error code
|
|
136
|
+
*/
|
|
137
|
+
RAC_API rac_result_t rac_vad_analytics_track_speech_start(rac_vad_analytics_handle_t handle);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @brief Track speech ended (silence detected after speech)
|
|
141
|
+
*
|
|
142
|
+
* @param handle Analytics service handle
|
|
143
|
+
* @return RAC_SUCCESS or error code
|
|
144
|
+
*/
|
|
145
|
+
RAC_API rac_result_t rac_vad_analytics_track_speech_end(rac_vad_analytics_handle_t handle);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @brief Track VAD paused
|
|
149
|
+
*
|
|
150
|
+
* @param handle Analytics service handle
|
|
151
|
+
* @return RAC_SUCCESS or error code
|
|
152
|
+
*/
|
|
153
|
+
RAC_API rac_result_t rac_vad_analytics_track_paused(rac_vad_analytics_handle_t handle);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @brief Track VAD resumed
|
|
157
|
+
*
|
|
158
|
+
* @param handle Analytics service handle
|
|
159
|
+
* @return RAC_SUCCESS or error code
|
|
160
|
+
*/
|
|
161
|
+
RAC_API rac_result_t rac_vad_analytics_track_resumed(rac_vad_analytics_handle_t handle);
|
|
162
|
+
|
|
163
|
+
// =============================================================================
|
|
164
|
+
// MODEL LIFECYCLE (for model-based VAD)
|
|
165
|
+
// =============================================================================
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @brief Track model load started
|
|
169
|
+
*
|
|
170
|
+
* @param handle Analytics service handle
|
|
171
|
+
* @param model_id The model identifier
|
|
172
|
+
* @param model_size_bytes Size of the model in bytes
|
|
173
|
+
* @param framework The inference framework
|
|
174
|
+
* @return RAC_SUCCESS or error code
|
|
175
|
+
*/
|
|
176
|
+
RAC_API rac_result_t rac_vad_analytics_track_model_load_started(
|
|
177
|
+
rac_vad_analytics_handle_t handle, const char* model_id, int64_t model_size_bytes,
|
|
178
|
+
rac_inference_framework_t framework);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @brief Track model load completed
|
|
182
|
+
*
|
|
183
|
+
* @param handle Analytics service handle
|
|
184
|
+
* @param model_id The model identifier
|
|
185
|
+
* @param duration_ms Time taken to load in milliseconds
|
|
186
|
+
* @param model_size_bytes Size of the model in bytes
|
|
187
|
+
* @return RAC_SUCCESS or error code
|
|
188
|
+
*/
|
|
189
|
+
RAC_API rac_result_t rac_vad_analytics_track_model_load_completed(rac_vad_analytics_handle_t handle,
|
|
190
|
+
const char* model_id,
|
|
191
|
+
double duration_ms,
|
|
192
|
+
int64_t model_size_bytes);
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @brief Track model load failed
|
|
196
|
+
*
|
|
197
|
+
* @param handle Analytics service handle
|
|
198
|
+
* @param model_id The model identifier
|
|
199
|
+
* @param error_code Error code
|
|
200
|
+
* @param error_message Error message
|
|
201
|
+
* @return RAC_SUCCESS or error code
|
|
202
|
+
*/
|
|
203
|
+
RAC_API rac_result_t rac_vad_analytics_track_model_load_failed(rac_vad_analytics_handle_t handle,
|
|
204
|
+
const char* model_id,
|
|
205
|
+
rac_result_t error_code,
|
|
206
|
+
const char* error_message);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @brief Track model unloaded
|
|
210
|
+
*
|
|
211
|
+
* @param handle Analytics service handle
|
|
212
|
+
* @param model_id The model identifier
|
|
213
|
+
* @return RAC_SUCCESS or error code
|
|
214
|
+
*/
|
|
215
|
+
RAC_API rac_result_t rac_vad_analytics_track_model_unloaded(rac_vad_analytics_handle_t handle,
|
|
216
|
+
const char* model_id);
|
|
217
|
+
|
|
218
|
+
// =============================================================================
|
|
219
|
+
// METRICS
|
|
220
|
+
// =============================================================================
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @brief Get current analytics metrics
|
|
224
|
+
*
|
|
225
|
+
* @param handle Analytics service handle
|
|
226
|
+
* @param out_metrics Output: Metrics structure
|
|
227
|
+
* @return RAC_SUCCESS or error code
|
|
228
|
+
*/
|
|
229
|
+
RAC_API rac_result_t rac_vad_analytics_get_metrics(rac_vad_analytics_handle_t handle,
|
|
230
|
+
rac_vad_metrics_t* out_metrics);
|
|
231
|
+
|
|
232
|
+
#ifdef __cplusplus
|
|
233
|
+
}
|
|
234
|
+
#endif
|
|
235
|
+
|
|
236
|
+
#endif /* RAC_VAD_ANALYTICS_H */
|