@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,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_stt_types.h
|
|
3
|
+
* @brief RunAnywhere Commons - STT Types and Data Structures
|
|
4
|
+
*
|
|
5
|
+
* C port of Swift's STT Models from:
|
|
6
|
+
* Sources/RunAnywhere/Features/STT/Models/STTConfiguration.swift
|
|
7
|
+
* Sources/RunAnywhere/Features/STT/Models/STTOptions.swift
|
|
8
|
+
* Sources/RunAnywhere/Features/STT/Models/STTInput.swift
|
|
9
|
+
* Sources/RunAnywhere/Features/STT/Models/STTOutput.swift
|
|
10
|
+
* Sources/RunAnywhere/Features/STT/Models/STTTranscriptionResult.swift
|
|
11
|
+
*
|
|
12
|
+
* This header defines data structures only. For the service interface,
|
|
13
|
+
* see rac_stt_service.h.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#ifndef RAC_STT_TYPES_H
|
|
17
|
+
#define RAC_STT_TYPES_H
|
|
18
|
+
|
|
19
|
+
#include "rac/core/rac_types.h"
|
|
20
|
+
|
|
21
|
+
#ifdef __cplusplus
|
|
22
|
+
extern "C" {
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// CONSTANTS - Single Source of Truth for STT
|
|
27
|
+
// Swift references these via CRACommons import
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
// Audio Format Constants
|
|
31
|
+
#define RAC_STT_DEFAULT_SAMPLE_RATE 16000
|
|
32
|
+
#define RAC_STT_MAX_SAMPLE_RATE 48000
|
|
33
|
+
#define RAC_STT_MIN_SAMPLE_RATE 8000
|
|
34
|
+
#define RAC_STT_BYTES_PER_SAMPLE 2
|
|
35
|
+
#define RAC_STT_CHANNELS 1
|
|
36
|
+
|
|
37
|
+
// Confidence Scores
|
|
38
|
+
#define RAC_STT_DEFAULT_CONFIDENCE 0.9f
|
|
39
|
+
#define RAC_STT_MIN_ACCEPTABLE_CONFIDENCE 0.5f
|
|
40
|
+
|
|
41
|
+
// Streaming Constants
|
|
42
|
+
#define RAC_STT_DEFAULT_STREAMING_CHUNK_MS 100
|
|
43
|
+
#define RAC_STT_MIN_STREAMING_CHUNK_MS 50
|
|
44
|
+
#define RAC_STT_MAX_STREAMING_CHUNK_MS 1000
|
|
45
|
+
|
|
46
|
+
// Language
|
|
47
|
+
#define RAC_STT_DEFAULT_LANGUAGE "en"
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// AUDIO FORMAT - Mirrors Swift's AudioFormat
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @brief Audio format enumeration
|
|
55
|
+
* Mirrors Swift's AudioFormat from AudioTypes.swift
|
|
56
|
+
*/
|
|
57
|
+
typedef enum rac_audio_format_enum {
|
|
58
|
+
RAC_AUDIO_FORMAT_PCM = 0,
|
|
59
|
+
RAC_AUDIO_FORMAT_WAV = 1,
|
|
60
|
+
RAC_AUDIO_FORMAT_MP3 = 2,
|
|
61
|
+
RAC_AUDIO_FORMAT_OPUS = 3,
|
|
62
|
+
RAC_AUDIO_FORMAT_AAC = 4,
|
|
63
|
+
RAC_AUDIO_FORMAT_FLAC = 5
|
|
64
|
+
} rac_audio_format_enum_t;
|
|
65
|
+
|
|
66
|
+
// =============================================================================
|
|
67
|
+
// CONFIGURATION - Mirrors Swift's STTConfiguration
|
|
68
|
+
// =============================================================================
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @brief STT component configuration
|
|
72
|
+
*
|
|
73
|
+
* Mirrors Swift's STTConfiguration struct exactly.
|
|
74
|
+
* See: Sources/RunAnywhere/Features/STT/Models/STTConfiguration.swift
|
|
75
|
+
*/
|
|
76
|
+
typedef struct rac_stt_config {
|
|
77
|
+
/** Model ID (optional - uses default if NULL) */
|
|
78
|
+
const char* model_id;
|
|
79
|
+
|
|
80
|
+
/** Preferred framework for transcription (use -1 for auto) */
|
|
81
|
+
int32_t preferred_framework;
|
|
82
|
+
|
|
83
|
+
/** Language code for transcription (e.g., "en-US") */
|
|
84
|
+
const char* language;
|
|
85
|
+
|
|
86
|
+
/** Sample rate in Hz (default: 16000) */
|
|
87
|
+
int32_t sample_rate;
|
|
88
|
+
|
|
89
|
+
/** Enable automatic punctuation in transcription */
|
|
90
|
+
rac_bool_t enable_punctuation;
|
|
91
|
+
|
|
92
|
+
/** Enable speaker diarization */
|
|
93
|
+
rac_bool_t enable_diarization;
|
|
94
|
+
|
|
95
|
+
/** Vocabulary list for improved recognition (NULL-terminated array, can be NULL) */
|
|
96
|
+
const char* const* vocabulary_list;
|
|
97
|
+
size_t num_vocabulary;
|
|
98
|
+
|
|
99
|
+
/** Maximum number of alternative transcriptions (default: 1) */
|
|
100
|
+
int32_t max_alternatives;
|
|
101
|
+
|
|
102
|
+
/** Enable word-level timestamps */
|
|
103
|
+
rac_bool_t enable_timestamps;
|
|
104
|
+
} rac_stt_config_t;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @brief Default STT configuration
|
|
108
|
+
*/
|
|
109
|
+
static const rac_stt_config_t RAC_STT_CONFIG_DEFAULT = {.model_id = RAC_NULL,
|
|
110
|
+
.preferred_framework = -1,
|
|
111
|
+
.language = "en-US",
|
|
112
|
+
.sample_rate = RAC_STT_DEFAULT_SAMPLE_RATE,
|
|
113
|
+
.enable_punctuation = RAC_TRUE,
|
|
114
|
+
.enable_diarization = RAC_FALSE,
|
|
115
|
+
.vocabulary_list = RAC_NULL,
|
|
116
|
+
.num_vocabulary = 0,
|
|
117
|
+
.max_alternatives = 1,
|
|
118
|
+
.enable_timestamps = RAC_TRUE};
|
|
119
|
+
|
|
120
|
+
// =============================================================================
|
|
121
|
+
// OPTIONS - Mirrors Swift's STTOptions
|
|
122
|
+
// =============================================================================
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @brief STT transcription options
|
|
126
|
+
*
|
|
127
|
+
* Mirrors Swift's STTOptions struct.
|
|
128
|
+
* See: Sources/RunAnywhere/Features/STT/Models/STTOptions.swift
|
|
129
|
+
*/
|
|
130
|
+
typedef struct rac_stt_options {
|
|
131
|
+
/** Language code for transcription (e.g., "en", "es", "fr") */
|
|
132
|
+
const char* language;
|
|
133
|
+
|
|
134
|
+
/** Whether to auto-detect the spoken language */
|
|
135
|
+
rac_bool_t detect_language;
|
|
136
|
+
|
|
137
|
+
/** Enable automatic punctuation in transcription */
|
|
138
|
+
rac_bool_t enable_punctuation;
|
|
139
|
+
|
|
140
|
+
/** Enable speaker diarization */
|
|
141
|
+
rac_bool_t enable_diarization;
|
|
142
|
+
|
|
143
|
+
/** Maximum number of speakers (0 = auto) */
|
|
144
|
+
int32_t max_speakers;
|
|
145
|
+
|
|
146
|
+
/** Enable word-level timestamps */
|
|
147
|
+
rac_bool_t enable_timestamps;
|
|
148
|
+
|
|
149
|
+
/** Audio format of input data */
|
|
150
|
+
rac_audio_format_enum_t audio_format;
|
|
151
|
+
|
|
152
|
+
/** Sample rate of input audio (default: 16000 Hz) */
|
|
153
|
+
int32_t sample_rate;
|
|
154
|
+
} rac_stt_options_t;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @brief Default STT options
|
|
158
|
+
*/
|
|
159
|
+
static const rac_stt_options_t RAC_STT_OPTIONS_DEFAULT = {.language = "en",
|
|
160
|
+
.detect_language = RAC_FALSE,
|
|
161
|
+
.enable_punctuation = RAC_TRUE,
|
|
162
|
+
.enable_diarization = RAC_FALSE,
|
|
163
|
+
.max_speakers = 0,
|
|
164
|
+
.enable_timestamps = RAC_TRUE,
|
|
165
|
+
.audio_format = RAC_AUDIO_FORMAT_PCM,
|
|
166
|
+
.sample_rate = 16000};
|
|
167
|
+
|
|
168
|
+
// =============================================================================
|
|
169
|
+
// RESULT - Mirrors Swift's STTTranscriptionResult
|
|
170
|
+
// =============================================================================
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @brief Word timestamp information
|
|
174
|
+
*/
|
|
175
|
+
typedef struct rac_stt_word {
|
|
176
|
+
/** The word text */
|
|
177
|
+
const char* text;
|
|
178
|
+
/** Start time in milliseconds */
|
|
179
|
+
int64_t start_ms;
|
|
180
|
+
/** End time in milliseconds */
|
|
181
|
+
int64_t end_ms;
|
|
182
|
+
/** Confidence score (0.0 to 1.0) */
|
|
183
|
+
float confidence;
|
|
184
|
+
} rac_stt_word_t;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @brief STT transcription result
|
|
188
|
+
*
|
|
189
|
+
* Mirrors Swift's STTTranscriptionResult struct.
|
|
190
|
+
*/
|
|
191
|
+
typedef struct rac_stt_result {
|
|
192
|
+
/** Full transcribed text (owned, must be freed with rac_free) */
|
|
193
|
+
char* text;
|
|
194
|
+
|
|
195
|
+
/** Detected language code (can be NULL) */
|
|
196
|
+
char* detected_language;
|
|
197
|
+
|
|
198
|
+
/** Word-level timestamps (can be NULL) */
|
|
199
|
+
rac_stt_word_t* words;
|
|
200
|
+
size_t num_words;
|
|
201
|
+
|
|
202
|
+
/** Overall confidence score (0.0 to 1.0) */
|
|
203
|
+
float confidence;
|
|
204
|
+
|
|
205
|
+
/** Processing time in milliseconds */
|
|
206
|
+
int64_t processing_time_ms;
|
|
207
|
+
} rac_stt_result_t;
|
|
208
|
+
|
|
209
|
+
// =============================================================================
|
|
210
|
+
// INFO - Mirrors Swift's STTService properties
|
|
211
|
+
// =============================================================================
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @brief STT service info
|
|
215
|
+
*/
|
|
216
|
+
typedef struct rac_stt_info {
|
|
217
|
+
/** Whether the service is ready */
|
|
218
|
+
rac_bool_t is_ready;
|
|
219
|
+
|
|
220
|
+
/** Current model identifier (can be NULL) */
|
|
221
|
+
const char* current_model;
|
|
222
|
+
|
|
223
|
+
/** Whether streaming is supported */
|
|
224
|
+
rac_bool_t supports_streaming;
|
|
225
|
+
} rac_stt_info_t;
|
|
226
|
+
|
|
227
|
+
// =============================================================================
|
|
228
|
+
// CALLBACKS
|
|
229
|
+
// =============================================================================
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @brief STT streaming callback
|
|
233
|
+
*
|
|
234
|
+
* Called for partial transcription results during streaming.
|
|
235
|
+
*
|
|
236
|
+
* @param partial_text Partial transcription text
|
|
237
|
+
* @param is_final Whether this is a final result
|
|
238
|
+
* @param user_data User-provided context
|
|
239
|
+
*/
|
|
240
|
+
typedef void (*rac_stt_stream_callback_t)(const char* partial_text, rac_bool_t is_final,
|
|
241
|
+
void* user_data);
|
|
242
|
+
|
|
243
|
+
// =============================================================================
|
|
244
|
+
// INPUT - Mirrors Swift's STTInput
|
|
245
|
+
// =============================================================================
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @brief STT input data
|
|
249
|
+
*
|
|
250
|
+
* Mirrors Swift's STTInput struct.
|
|
251
|
+
* See: Sources/RunAnywhere/Features/STT/Models/STTInput.swift
|
|
252
|
+
*/
|
|
253
|
+
typedef struct rac_stt_input {
|
|
254
|
+
/** Audio data bytes (raw audio data) */
|
|
255
|
+
const uint8_t* audio_data;
|
|
256
|
+
size_t audio_data_size;
|
|
257
|
+
|
|
258
|
+
/** Alternative: audio buffer (PCM float samples) */
|
|
259
|
+
const float* audio_samples;
|
|
260
|
+
size_t num_samples;
|
|
261
|
+
|
|
262
|
+
/** Audio format of input data */
|
|
263
|
+
rac_audio_format_enum_t format;
|
|
264
|
+
|
|
265
|
+
/** Language code override (can be NULL to use config default) */
|
|
266
|
+
const char* language;
|
|
267
|
+
|
|
268
|
+
/** Sample rate of the audio (default: 16000) */
|
|
269
|
+
int32_t sample_rate;
|
|
270
|
+
|
|
271
|
+
/** Custom options override (can be NULL) */
|
|
272
|
+
const rac_stt_options_t* options;
|
|
273
|
+
} rac_stt_input_t;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @brief Default STT input
|
|
277
|
+
*/
|
|
278
|
+
static const rac_stt_input_t RAC_STT_INPUT_DEFAULT = {.audio_data = RAC_NULL,
|
|
279
|
+
.audio_data_size = 0,
|
|
280
|
+
.audio_samples = RAC_NULL,
|
|
281
|
+
.num_samples = 0,
|
|
282
|
+
.format = RAC_AUDIO_FORMAT_PCM,
|
|
283
|
+
.language = RAC_NULL,
|
|
284
|
+
.sample_rate = RAC_STT_DEFAULT_SAMPLE_RATE,
|
|
285
|
+
.options = RAC_NULL};
|
|
286
|
+
|
|
287
|
+
// =============================================================================
|
|
288
|
+
// TRANSCRIPTION METADATA - Mirrors Swift's TranscriptionMetadata
|
|
289
|
+
// =============================================================================
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @brief Transcription metadata
|
|
293
|
+
*
|
|
294
|
+
* Mirrors Swift's TranscriptionMetadata struct.
|
|
295
|
+
* See: Sources/RunAnywhere/Features/STT/Models/STTOutput.swift
|
|
296
|
+
*/
|
|
297
|
+
typedef struct rac_transcription_metadata {
|
|
298
|
+
/** Model ID used for transcription */
|
|
299
|
+
const char* model_id;
|
|
300
|
+
|
|
301
|
+
/** Processing time in milliseconds */
|
|
302
|
+
int64_t processing_time_ms;
|
|
303
|
+
|
|
304
|
+
/** Audio length in milliseconds */
|
|
305
|
+
int64_t audio_length_ms;
|
|
306
|
+
|
|
307
|
+
/** Real-time factor (processing_time / audio_length) */
|
|
308
|
+
float real_time_factor;
|
|
309
|
+
} rac_transcription_metadata_t;
|
|
310
|
+
|
|
311
|
+
// =============================================================================
|
|
312
|
+
// TRANSCRIPTION ALTERNATIVE - Mirrors Swift's TranscriptionAlternative
|
|
313
|
+
// =============================================================================
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @brief Alternative transcription
|
|
317
|
+
*
|
|
318
|
+
* Mirrors Swift's TranscriptionAlternative struct.
|
|
319
|
+
*/
|
|
320
|
+
typedef struct rac_transcription_alternative {
|
|
321
|
+
/** Alternative transcription text */
|
|
322
|
+
const char* text;
|
|
323
|
+
|
|
324
|
+
/** Confidence score (0.0 to 1.0) */
|
|
325
|
+
float confidence;
|
|
326
|
+
} rac_transcription_alternative_t;
|
|
327
|
+
|
|
328
|
+
// =============================================================================
|
|
329
|
+
// OUTPUT - Mirrors Swift's STTOutput
|
|
330
|
+
// =============================================================================
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* @brief STT output data
|
|
334
|
+
*
|
|
335
|
+
* Mirrors Swift's STTOutput struct.
|
|
336
|
+
* See: Sources/RunAnywhere/Features/STT/Models/STTOutput.swift
|
|
337
|
+
*/
|
|
338
|
+
typedef struct rac_stt_output {
|
|
339
|
+
/** Transcribed text (owned, must be freed with rac_free) */
|
|
340
|
+
char* text;
|
|
341
|
+
|
|
342
|
+
/** Confidence score (0.0 to 1.0) */
|
|
343
|
+
float confidence;
|
|
344
|
+
|
|
345
|
+
/** Word-level timestamps (can be NULL) */
|
|
346
|
+
rac_stt_word_t* word_timestamps;
|
|
347
|
+
size_t num_word_timestamps;
|
|
348
|
+
|
|
349
|
+
/** Detected language if auto-detected (can be NULL) */
|
|
350
|
+
char* detected_language;
|
|
351
|
+
|
|
352
|
+
/** Alternative transcriptions (can be NULL) */
|
|
353
|
+
rac_transcription_alternative_t* alternatives;
|
|
354
|
+
size_t num_alternatives;
|
|
355
|
+
|
|
356
|
+
/** Processing metadata */
|
|
357
|
+
rac_transcription_metadata_t metadata;
|
|
358
|
+
|
|
359
|
+
/** Timestamp in milliseconds since epoch */
|
|
360
|
+
int64_t timestamp_ms;
|
|
361
|
+
} rac_stt_output_t;
|
|
362
|
+
|
|
363
|
+
// =============================================================================
|
|
364
|
+
// TRANSCRIPTION RESULT - Alias for compatibility
|
|
365
|
+
// =============================================================================
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* @brief STT transcription result (alias for rac_stt_output_t)
|
|
369
|
+
*
|
|
370
|
+
* For compatibility with existing code that uses "result" terminology.
|
|
371
|
+
*/
|
|
372
|
+
typedef rac_stt_output_t rac_stt_transcription_result_t;
|
|
373
|
+
|
|
374
|
+
// =============================================================================
|
|
375
|
+
// MEMORY MANAGEMENT
|
|
376
|
+
// =============================================================================
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @brief Free STT result resources
|
|
380
|
+
*
|
|
381
|
+
* @param result Result to free (can be NULL)
|
|
382
|
+
*/
|
|
383
|
+
RAC_API void rac_stt_result_free(rac_stt_result_t* result);
|
|
384
|
+
|
|
385
|
+
#ifdef __cplusplus
|
|
386
|
+
}
|
|
387
|
+
#endif
|
|
388
|
+
|
|
389
|
+
#endif /* RAC_STT_TYPES_H */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_tts.h
|
|
3
|
+
* @brief RunAnywhere Commons - TTS 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_tts_types.h for data structures only
|
|
8
|
+
* - rac_tts_service.h for the service interface
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef RAC_TTS_H
|
|
12
|
+
#define RAC_TTS_H
|
|
13
|
+
|
|
14
|
+
#include "rac/features/tts/rac_tts_service.h"
|
|
15
|
+
#include "rac/features/tts/rac_tts_types.h"
|
|
16
|
+
|
|
17
|
+
#endif /* RAC_TTS_H */
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file rac_tts_analytics.h
|
|
3
|
+
* @brief TTS analytics service - 1:1 port of TTSAnalyticsService.swift
|
|
4
|
+
*
|
|
5
|
+
* Tracks synthesis operations and metrics.
|
|
6
|
+
* Lifecycle events are handled by the lifecycle manager.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: Audio duration estimation assumes 16-bit PCM @ 22050Hz (standard for TTS).
|
|
9
|
+
* Formula: audioDurationMs = (bytes / 2) / 22050 * 1000
|
|
10
|
+
*
|
|
11
|
+
* Swift Source: Sources/RunAnywhere/Features/TTS/Analytics/TTSAnalyticsService.swift
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef RAC_TTS_ANALYTICS_H
|
|
15
|
+
#define RAC_TTS_ANALYTICS_H
|
|
16
|
+
|
|
17
|
+
#include "rac/core/rac_types.h"
|
|
18
|
+
#include "rac/features/tts/rac_tts_types.h"
|
|
19
|
+
#include "rac/infrastructure/model_management/rac_model_types.h"
|
|
20
|
+
|
|
21
|
+
#ifdef __cplusplus
|
|
22
|
+
extern "C" {
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// TYPES
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @brief Opaque handle for TTS analytics service
|
|
31
|
+
*/
|
|
32
|
+
typedef struct rac_tts_analytics_s* rac_tts_analytics_handle_t;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @brief TTS metrics structure
|
|
36
|
+
* Mirrors Swift's TTSMetrics struct
|
|
37
|
+
*/
|
|
38
|
+
typedef struct rac_tts_metrics {
|
|
39
|
+
/** Total number of events tracked */
|
|
40
|
+
int32_t total_events;
|
|
41
|
+
|
|
42
|
+
/** Start time (milliseconds since epoch) */
|
|
43
|
+
int64_t start_time_ms;
|
|
44
|
+
|
|
45
|
+
/** Last event time (milliseconds since epoch, 0 if no events) */
|
|
46
|
+
int64_t last_event_time_ms;
|
|
47
|
+
|
|
48
|
+
/** Total number of syntheses */
|
|
49
|
+
int32_t total_syntheses;
|
|
50
|
+
|
|
51
|
+
/** Average synthesis speed (characters processed per second) */
|
|
52
|
+
double average_characters_per_second;
|
|
53
|
+
|
|
54
|
+
/** Average processing time in milliseconds */
|
|
55
|
+
double average_processing_time_ms;
|
|
56
|
+
|
|
57
|
+
/** Average audio duration in milliseconds */
|
|
58
|
+
double average_audio_duration_ms;
|
|
59
|
+
|
|
60
|
+
/** Total characters processed across all syntheses */
|
|
61
|
+
int32_t total_characters_processed;
|
|
62
|
+
|
|
63
|
+
/** Total audio size generated in bytes */
|
|
64
|
+
int64_t total_audio_size_bytes;
|
|
65
|
+
} rac_tts_metrics_t;
|
|
66
|
+
|
|
67
|
+
// =============================================================================
|
|
68
|
+
// LIFECYCLE
|
|
69
|
+
// =============================================================================
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @brief Create a TTS analytics service instance
|
|
73
|
+
*
|
|
74
|
+
* @param out_handle Output: Handle to the created service
|
|
75
|
+
* @return RAC_SUCCESS or error code
|
|
76
|
+
*/
|
|
77
|
+
RAC_API rac_result_t rac_tts_analytics_create(rac_tts_analytics_handle_t* out_handle);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @brief Destroy a TTS analytics service instance
|
|
81
|
+
*
|
|
82
|
+
* @param handle Handle to destroy
|
|
83
|
+
*/
|
|
84
|
+
RAC_API void rac_tts_analytics_destroy(rac_tts_analytics_handle_t handle);
|
|
85
|
+
|
|
86
|
+
// =============================================================================
|
|
87
|
+
// SYNTHESIS TRACKING
|
|
88
|
+
// =============================================================================
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @brief Start tracking a synthesis
|
|
92
|
+
*
|
|
93
|
+
* @param handle Analytics service handle
|
|
94
|
+
* @param text The text to synthesize
|
|
95
|
+
* @param voice The voice ID being used
|
|
96
|
+
* @param sample_rate Audio sample rate in Hz (default: 22050)
|
|
97
|
+
* @param framework The inference framework being used
|
|
98
|
+
* @param out_synthesis_id Output: Generated unique ID (owned, must be freed with rac_free)
|
|
99
|
+
* @return RAC_SUCCESS or error code
|
|
100
|
+
*/
|
|
101
|
+
RAC_API rac_result_t rac_tts_analytics_start_synthesis(rac_tts_analytics_handle_t handle,
|
|
102
|
+
const char* text, const char* voice,
|
|
103
|
+
int32_t sample_rate,
|
|
104
|
+
rac_inference_framework_t framework,
|
|
105
|
+
char** out_synthesis_id);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @brief Track synthesis chunk (for streaming synthesis)
|
|
109
|
+
*
|
|
110
|
+
* @param handle Analytics service handle
|
|
111
|
+
* @param synthesis_id The synthesis ID
|
|
112
|
+
* @param chunk_size Size of the chunk in bytes
|
|
113
|
+
* @return RAC_SUCCESS or error code
|
|
114
|
+
*/
|
|
115
|
+
RAC_API rac_result_t rac_tts_analytics_track_synthesis_chunk(rac_tts_analytics_handle_t handle,
|
|
116
|
+
const char* synthesis_id,
|
|
117
|
+
int32_t chunk_size);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @brief Complete a synthesis
|
|
121
|
+
*
|
|
122
|
+
* @param handle Analytics service handle
|
|
123
|
+
* @param synthesis_id The synthesis ID
|
|
124
|
+
* @param audio_duration_ms Duration of the generated audio in milliseconds
|
|
125
|
+
* @param audio_size_bytes Size of the generated audio in bytes
|
|
126
|
+
* @return RAC_SUCCESS or error code
|
|
127
|
+
*/
|
|
128
|
+
RAC_API rac_result_t rac_tts_analytics_complete_synthesis(rac_tts_analytics_handle_t handle,
|
|
129
|
+
const char* synthesis_id,
|
|
130
|
+
double audio_duration_ms,
|
|
131
|
+
int32_t audio_size_bytes);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @brief Track synthesis failure
|
|
135
|
+
*
|
|
136
|
+
* @param handle Analytics service handle
|
|
137
|
+
* @param synthesis_id The synthesis ID
|
|
138
|
+
* @param error_code Error code
|
|
139
|
+
* @param error_message Error message
|
|
140
|
+
* @return RAC_SUCCESS or error code
|
|
141
|
+
*/
|
|
142
|
+
RAC_API rac_result_t rac_tts_analytics_track_synthesis_failed(rac_tts_analytics_handle_t handle,
|
|
143
|
+
const char* synthesis_id,
|
|
144
|
+
rac_result_t error_code,
|
|
145
|
+
const char* error_message);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @brief Track an error during TTS operations
|
|
149
|
+
*
|
|
150
|
+
* @param handle Analytics service handle
|
|
151
|
+
* @param error_code Error code
|
|
152
|
+
* @param error_message Error message
|
|
153
|
+
* @param operation Operation that failed
|
|
154
|
+
* @param model_id Model ID (can be NULL)
|
|
155
|
+
* @param synthesis_id Synthesis ID (can be NULL)
|
|
156
|
+
* @return RAC_SUCCESS or error code
|
|
157
|
+
*/
|
|
158
|
+
RAC_API rac_result_t rac_tts_analytics_track_error(rac_tts_analytics_handle_t handle,
|
|
159
|
+
rac_result_t error_code,
|
|
160
|
+
const char* error_message, const char* operation,
|
|
161
|
+
const char* model_id, const char* synthesis_id);
|
|
162
|
+
|
|
163
|
+
// =============================================================================
|
|
164
|
+
// METRICS
|
|
165
|
+
// =============================================================================
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @brief Get current analytics metrics
|
|
169
|
+
*
|
|
170
|
+
* @param handle Analytics service handle
|
|
171
|
+
* @param out_metrics Output: Metrics structure
|
|
172
|
+
* @return RAC_SUCCESS or error code
|
|
173
|
+
*/
|
|
174
|
+
RAC_API rac_result_t rac_tts_analytics_get_metrics(rac_tts_analytics_handle_t handle,
|
|
175
|
+
rac_tts_metrics_t* out_metrics);
|
|
176
|
+
|
|
177
|
+
#ifdef __cplusplus
|
|
178
|
+
}
|
|
179
|
+
#endif
|
|
180
|
+
|
|
181
|
+
#endif /* RAC_TTS_ANALYTICS_H */
|