This module provides core functionality for testing library initialization and detecting hardware acceleration support on different platforms.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/XDcobra/react-native-sherpa-onnx/llms.txt
Use this file to discover all available pages before exploring further.
testSherpaInit()
Test method to verify that the sherpa-onnx native library is loaded correctly.Returns
Resolves with a test message confirming the library is loaded.
Example
getQnnSupport()
Check Qualcomm QNN (Qualcomm Neural Network) acceleration support on Android devices.Parameters
Optional base64-encoded model for session initialization test. If omitted, uses an embedded test model.
Returns
Platform Support
- Android: Full support on Qualcomm devices
- iOS: Returns all false
Example
getNnapiSupport()
Check NNAPI (Android Neural Networks API) acceleration support on Android devices.Parameters
Optional base64-encoded model for session initialization test.
Returns
See getQnnSupport() for structure.
Platform Support
- Android: Support varies by device and Android version
- iOS: Returns all false
Example
getXnnpackSupport()
Check XNNPACK (CPU-optimized) acceleration support.Parameters
Optional base64-encoded model for session initialization test.
Returns
Platform Support
- Android: Full support (CPU-optimized inference)
- iOS: Returns all false
Example
getCoreMlSupport()
Check Core ML acceleration support on iOS devices with Apple Neural Engine.Parameters
Optional base64-encoded model for session initialization test.
Returns
Platform Support
- iOS: Full support on iOS 11+ with Apple Neural Engine
- Android: Returns all false
Example
getAvailableProviders()
Get the list of available ONNX Runtime execution providers on the current device.Returns
Array of provider names (e.g.,
["CPU", "NNAPI", "QNN", "XNNPACK"]).Platform Support
Requires the ONNX Runtime Java bridge from the onnxruntime AAR.Example
Types
AccelerationSupport
Result type for hardware acceleration queries.See Also
- Model Path Utilities - Utilities for resolving model paths
- STT API - Speech-to-text API
- TTS API - Text-to-speech API