Getting Started — Linux
speech-android includes a C API for embedded Linux platforms (automotive, Yocto, edge devices). Same speech-core pipeline as Android, targeting ARM64 and x86_64.
Requirements
- ARM64 or x86_64 Linux
- ONNX Runtime
Setup
git clone --recursive https://github.com/soniqo/speech-android.git
cd speech-android/linux
./setup_linux.sh
cmake -B build -DORT_DIR=../ort-linux
cmake --build build
C API Example
#include <speech.h>
void on_event(const speech_event_t* event, void* ctx) {
if (event->type == SPEECH_EVENT_TRANSCRIPTION)
printf("%s\n", event->text);
}
speech_config_t cfg = speech_config_default();
cfg.model_dir = "/opt/speech/models";
speech_pipeline_t p = speech_create(cfg, on_event, NULL);
speech_start(p);
speech_push_audio(p, samples, 512);
Important
For Yocto cross-compilation, set ORT_DIR to your sysroot's ONNX Runtime installation and use the appropriate CMake toolchain file.
Source code: github.com/soniqo/speech-android/tree/main/linux
Next Steps
- Android Getting Started — Android SDK setup
- Benchmarks — Android/Linux inference performance