Başlangıç — Linux

speech-core, gömülü Linux platformları (otomotiv, Yocto, uç cihazlar) için examples/linux/ altında bir C API içerir. Android'i çalıştıran aynı C++ pipeline motoru olup ARM64 ve x86_64 hedeflenir. ONNX Runtime, kurulum betiği tarafından otomatik olarak indirilir.

Gereksinimler

Kurulum

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

# İsteğe bağlı — gerçek modellerle entegrasyon testlerini çalıştırın
scripts/download_models.sh
SPEECH_MODEL_DIR=scripts/models ctest --test-dir build --output-on-failure

C API Örneği

#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);
Önemli

Yocto çapraz derlemesi için ORT_DIR'i sysroot'unuzdaki ONNX Runtime kurulumuna ayarlayın ve uygun CMake toolchain dosyasını kullanın.

Kaynak kodu: github.com/soniqo/speech-core/tree/main/examples/linux

Sonraki Adımlar