Getting Started — Linux
speech-core includes a C API for embedded Linux platforms (automotive, Yocto, edge devices) under examples/linux/. Same C++ pipeline engine that powers Android, targeting ARM64 and x86_64. ONNX Runtime is fetched automatically by the setup script.
Requirements
- ARM64 or x86_64 Linux
- cmake 3.16+, build-essential
- libasound2-dev (for the ALSA demo — optional)
Setup
git clone https://github.com/soniqo/speech-core.git
cd speech-core
./examples/linux/setup_linux.sh
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DSPEECH_CORE_WITH_ONNX=ON \
-DSPEECH_CORE_BUILD_EXAMPLES=ON \
-DORT_DIR=ort-linux
cmake --build build
# Optional — run the integration tests against real models
scripts/download_models.sh
SPEECH_MODEL_DIR=scripts/models ctest --test-dir build --output-on-failure
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-core/tree/main/examples/linux
Next Steps
- Android Getting Started — Android SDK setup
- Benchmarks — Android/Linux inference performance