Skip to main content

Crate nemotron_asr_sys

Crate nemotron_asr_sys 

Source
Expand description

Low-level FFI bindings for nemotron-asr.cpp

This crate provides raw, unsafe bindings to the C API of nemotron-asr.cpp. For a safe, idiomatic Rust API, use the nemotron-asr crate instead.

§Usage

The bindings are automatically generated from the C header files using bindgen. All functions are unsafe and require careful handling of pointers and memory management.

§Example

use nemotron_asr_sys::*;
use std::ffi::CString;
use std::ptr;

unsafe {
    // Initialize model with default backend
    let model_path = CString::new("/path/to/model.gguf").unwrap();
    let ctx = c_nemo_init_with_backend(model_path.as_ptr(), ptr::null());

    if !ctx.is_null() {
        // Create streaming context with default config
        let stream_ctx = c_nemo_stream_init(ctx, ptr::null());

        // Process audio...

        // Cleanup
        c_nemo_stream_free(stream_ctx);
        c_nemo_free(ctx);
    }
}

Structs§

ggml_backend_device
nemo_cache_config
nemo_context
nemo_stream_context

Enums§

nemo_latency_mode

Functions§

c_nemo_free
c_nemo_free_string
c_nemo_get_backend_name
c_nemo_init_with_backend
c_nemo_stream_finalize
c_nemo_stream_free
c_nemo_stream_get_transcript
c_nemo_stream_init
c_nemo_stream_process_incremental
c_nemo_stream_reset
ggml_backend_dev_count
ggml_backend_dev_get
ggml_backend_dev_name
ggml_backend_load_all_from_path
nemo_cache_config_default
nemo_cache_config_get_chunk_mel_frames
nemo_cache_config_get_chunk_samples
nemo_cache_config_get_latency_ms
nemo_cache_config_get_shift_mel_frames_val
nemo_cache_config_get_valid_out_len
nemo_cache_config_with_latency

Type Aliases§

ggml_backend_dev_t
nemo_context_ffi
nemo_stream_context_ffi