תרגום מכונה · המקור באנגלית

להתחיל - Linux

speech-core כולל C API עבור פלטפורמות Linux משובצות (automotive, Yocto, קצה מכשירים) תחת מכשירים) examples/linux/אותו מנוע צינורות C++ אשר מאלץ Android, מיקוד ARM64 ו x86_64. ONNX Runtime מופק אוטומטית על ידי תסריט ההתקנה.

דרישות דרישות

התקנה

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 דוגמה

#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);
חשוב

עבור Yocto cross-compilation, להגדיר ORT_DIR לקובץ ה- ONNX Runtime ולהשתמש בקובץ CMake Toolchain.

קוד מקור: Zthub.com / soniqo/speech-core / Street/main/examples/linux

צעדים הבאים