pub const PUBLIC_HEADER_HASH: &str = "86b16dd97ad1cb58";
pub const TRANSCRIBE_EXT_KIND_MOONSHINE_STREAMING_STREAM: u32 = 1414746957;
pub const TRANSCRIBE_EXT_KIND_PARAKEET_STREAM: u32 = 1414744912;
pub const TRANSCRIBE_EXT_KIND_PARAKEET_BUFFERED_STREAM: u32 = 1396853584;
pub const TRANSCRIBE_EXT_KIND_VOXTRAL_REALTIME_STREAM: u32 = 1414746710;
pub const TRANSCRIBE_EXT_KIND_WHISPER_RUN: u32 = 1314015319;
impl transcribe_status {
pub const TRANSCRIBE_OK: transcribe_status = transcribe_status(0);
pub const TRANSCRIBE_ERR_INVALID_ARG: transcribe_status = transcribe_status(1);
pub const TRANSCRIBE_ERR_NOT_IMPLEMENTED: transcribe_status = transcribe_status(2);
pub const TRANSCRIBE_ERR_FILE_NOT_FOUND: transcribe_status = transcribe_status(3);
pub const TRANSCRIBE_ERR_GGUF: transcribe_status = transcribe_status(4);
pub const TRANSCRIBE_ERR_UNSUPPORTED_ARCH: transcribe_status = transcribe_status(5);
pub const TRANSCRIBE_ERR_UNSUPPORTED_VARIANT: transcribe_status = transcribe_status(6);
pub const TRANSCRIBE_ERR_OOM: transcribe_status = transcribe_status(7);
pub const TRANSCRIBE_ERR_BACKEND: transcribe_status = transcribe_status(8);
pub const TRANSCRIBE_ERR_SAMPLE_RATE: transcribe_status = transcribe_status(9);
pub const TRANSCRIBE_ERR_UNSUPPORTED_LANGUAGE: transcribe_status = transcribe_status(10);
pub const TRANSCRIBE_ERR_UNSUPPORTED_TASK: transcribe_status = transcribe_status(11);
pub const TRANSCRIBE_ERR_UNSUPPORTED_TIMESTAMPS: transcribe_status = transcribe_status(12);
pub const TRANSCRIBE_ERR_ABORTED: transcribe_status = transcribe_status(13);
pub const TRANSCRIBE_ERR_BAD_STRUCT_SIZE: transcribe_status = transcribe_status(14);
pub const TRANSCRIBE_ERR_UNSUPPORTED_PNC: transcribe_status = transcribe_status(15);
pub const TRANSCRIBE_ERR_UNSUPPORTED_ITN: transcribe_status = transcribe_status(16);
pub const TRANSCRIBE_ERR_INPUT_TOO_LONG: transcribe_status = transcribe_status(17);
pub const TRANSCRIBE_ERR_OUTPUT_TRUNCATED: transcribe_status = transcribe_status(18);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_status(pub ::std::os::raw::c_uint);
unsafe extern "C" {
pub fn transcribe_status_string(status: ::std::os::raw::c_int)
-> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_version() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_version_commit() -> *const ::std::os::raw::c_char;
}
impl transcribe_abi_struct {
pub const TRANSCRIBE_ABI_MODEL_LOAD_PARAMS: transcribe_abi_struct = transcribe_abi_struct(0);
pub const TRANSCRIBE_ABI_SESSION_PARAMS: transcribe_abi_struct = transcribe_abi_struct(1);
pub const TRANSCRIBE_ABI_RUN_PARAMS: transcribe_abi_struct = transcribe_abi_struct(2);
pub const TRANSCRIBE_ABI_STREAM_PARAMS: transcribe_abi_struct = transcribe_abi_struct(3);
pub const TRANSCRIBE_ABI_CAPABILITIES: transcribe_abi_struct = transcribe_abi_struct(4);
pub const TRANSCRIBE_ABI_TIMINGS: transcribe_abi_struct = transcribe_abi_struct(5);
pub const TRANSCRIBE_ABI_SEGMENT: transcribe_abi_struct = transcribe_abi_struct(6);
pub const TRANSCRIBE_ABI_WORD: transcribe_abi_struct = transcribe_abi_struct(7);
pub const TRANSCRIBE_ABI_TOKEN: transcribe_abi_struct = transcribe_abi_struct(8);
pub const TRANSCRIBE_ABI_STREAM_UPDATE: transcribe_abi_struct = transcribe_abi_struct(9);
pub const TRANSCRIBE_ABI_STREAM_TEXT: transcribe_abi_struct = transcribe_abi_struct(10);
pub const TRANSCRIBE_ABI_SESSION_LIMITS: transcribe_abi_struct = transcribe_abi_struct(11);
pub const TRANSCRIBE_ABI_EXT: transcribe_abi_struct = transcribe_abi_struct(12);
pub const TRANSCRIBE_ABI_BACKEND_DEVICE: transcribe_abi_struct = transcribe_abi_struct(13);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_abi_struct(pub ::std::os::raw::c_uint);
unsafe extern "C" {
pub fn transcribe_abi_struct_size(which: transcribe_abi_struct) -> usize;
}
unsafe extern "C" {
pub fn transcribe_abi_struct_align(which: transcribe_abi_struct) -> usize;
}
impl transcribe_log_level {
pub const TRANSCRIBE_LOG_LEVEL_NONE: transcribe_log_level = transcribe_log_level(0);
pub const TRANSCRIBE_LOG_LEVEL_INFO: transcribe_log_level = transcribe_log_level(1);
pub const TRANSCRIBE_LOG_LEVEL_WARN: transcribe_log_level = transcribe_log_level(2);
pub const TRANSCRIBE_LOG_LEVEL_ERROR: transcribe_log_level = transcribe_log_level(3);
pub const TRANSCRIBE_LOG_LEVEL_DEBUG: transcribe_log_level = transcribe_log_level(4);
pub const TRANSCRIBE_LOG_LEVEL_CONT: transcribe_log_level = transcribe_log_level(5);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_log_level(pub ::std::os::raw::c_uint);
pub type transcribe_log_callback = ::std::option::Option<
unsafe extern "C" fn(
level: transcribe_log_level,
msg: *const ::std::os::raw::c_char,
userdata: *mut ::std::os::raw::c_void,
),
>;
unsafe extern "C" {
pub fn transcribe_log_set(cb: transcribe_log_callback, userdata: *mut ::std::os::raw::c_void);
}
impl transcribe_task {
pub const TRANSCRIBE_TASK_TRANSCRIBE: transcribe_task = transcribe_task(0);
pub const TRANSCRIBE_TASK_TRANSLATE: transcribe_task = transcribe_task(1);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_task(pub ::std::os::raw::c_uint);
impl transcribe_timestamp_kind {
pub const TRANSCRIBE_TIMESTAMPS_NONE: transcribe_timestamp_kind = transcribe_timestamp_kind(0);
pub const TRANSCRIBE_TIMESTAMPS_AUTO: transcribe_timestamp_kind = transcribe_timestamp_kind(1);
pub const TRANSCRIBE_TIMESTAMPS_SEGMENT: transcribe_timestamp_kind =
transcribe_timestamp_kind(2);
pub const TRANSCRIBE_TIMESTAMPS_WORD: transcribe_timestamp_kind = transcribe_timestamp_kind(3);
pub const TRANSCRIBE_TIMESTAMPS_TOKEN: transcribe_timestamp_kind = transcribe_timestamp_kind(4);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_timestamp_kind(pub ::std::os::raw::c_uint);
impl transcribe_kv_type {
pub const TRANSCRIBE_KV_TYPE_AUTO: transcribe_kv_type = transcribe_kv_type(0);
pub const TRANSCRIBE_KV_TYPE_F32: transcribe_kv_type = transcribe_kv_type(1);
pub const TRANSCRIBE_KV_TYPE_F16: transcribe_kv_type = transcribe_kv_type(2);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_kv_type(pub ::std::os::raw::c_uint);
impl transcribe_pnc_mode {
pub const TRANSCRIBE_PNC_MODE_DEFAULT: transcribe_pnc_mode = transcribe_pnc_mode(0);
pub const TRANSCRIBE_PNC_MODE_OFF: transcribe_pnc_mode = transcribe_pnc_mode(1);
pub const TRANSCRIBE_PNC_MODE_ON: transcribe_pnc_mode = transcribe_pnc_mode(2);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_pnc_mode(pub ::std::os::raw::c_uint);
impl transcribe_itn_mode {
pub const TRANSCRIBE_ITN_MODE_DEFAULT: transcribe_itn_mode = transcribe_itn_mode(0);
pub const TRANSCRIBE_ITN_MODE_OFF: transcribe_itn_mode = transcribe_itn_mode(1);
pub const TRANSCRIBE_ITN_MODE_ON: transcribe_itn_mode = transcribe_itn_mode(2);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_itn_mode(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_model {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_session {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_ext {
pub size: u64,
pub kind: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_ext"][::std::mem::size_of::<transcribe_ext>() - 16usize];
["Alignment of transcribe_ext"][::std::mem::align_of::<transcribe_ext>() - 8usize];
["Offset of field: transcribe_ext::size"]
[::std::mem::offset_of!(transcribe_ext, size) - 0usize];
["Offset of field: transcribe_ext::kind"]
[::std::mem::offset_of!(transcribe_ext, kind) - 8usize];
};
unsafe extern "C" {
pub fn transcribe_ext_check(
ext: *const transcribe_ext,
expected_kind: u32,
min_size: u64,
) -> transcribe_status;
}
impl transcribe_ext_slot {
pub const TRANSCRIBE_EXT_SLOT_RUN: transcribe_ext_slot = transcribe_ext_slot(0);
pub const TRANSCRIBE_EXT_SLOT_STREAM: transcribe_ext_slot = transcribe_ext_slot(1);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_ext_slot(pub ::std::os::raw::c_uint);
unsafe extern "C" {
pub fn transcribe_model_accepts_ext_kind(
model: *const transcribe_model,
slot: transcribe_ext_slot,
kind: u32,
) -> bool;
}
impl transcribe_backend_request {
pub const TRANSCRIBE_BACKEND_AUTO: transcribe_backend_request = transcribe_backend_request(0);
pub const TRANSCRIBE_BACKEND_CPU: transcribe_backend_request = transcribe_backend_request(1);
pub const TRANSCRIBE_BACKEND_METAL: transcribe_backend_request = transcribe_backend_request(2);
pub const TRANSCRIBE_BACKEND_VULKAN: transcribe_backend_request = transcribe_backend_request(3);
pub const TRANSCRIBE_BACKEND_CPU_ACCEL: transcribe_backend_request =
transcribe_backend_request(4);
pub const TRANSCRIBE_BACKEND_CUDA: transcribe_backend_request = transcribe_backend_request(5);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_backend_request(pub ::std::os::raw::c_uint);
unsafe extern "C" {
pub fn transcribe_init_backends(
artifact_dir: *const ::std::os::raw::c_char,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_init_backends_default() -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_backend_device_count() -> ::std::os::raw::c_int;
}
impl transcribe_device_type {
pub const TRANSCRIBE_DEVICE_TYPE_CPU: transcribe_device_type = transcribe_device_type(0);
pub const TRANSCRIBE_DEVICE_TYPE_GPU: transcribe_device_type = transcribe_device_type(1);
pub const TRANSCRIBE_DEVICE_TYPE_IGPU: transcribe_device_type = transcribe_device_type(2);
pub const TRANSCRIBE_DEVICE_TYPE_ACCEL: transcribe_device_type = transcribe_device_type(3);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_device_type(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_backend_device {
pub struct_size: u64,
pub name: *const ::std::os::raw::c_char,
pub description: *const ::std::os::raw::c_char,
pub kind: *const ::std::os::raw::c_char,
pub device_id: *const ::std::os::raw::c_char,
pub memory_total: u64,
pub memory_free: u64,
pub device_type: transcribe_device_type,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_backend_device"]
[::std::mem::size_of::<transcribe_backend_device>() - 64usize];
["Alignment of transcribe_backend_device"]
[::std::mem::align_of::<transcribe_backend_device>() - 8usize];
["Offset of field: transcribe_backend_device::struct_size"]
[::std::mem::offset_of!(transcribe_backend_device, struct_size) - 0usize];
["Offset of field: transcribe_backend_device::name"]
[::std::mem::offset_of!(transcribe_backend_device, name) - 8usize];
["Offset of field: transcribe_backend_device::description"]
[::std::mem::offset_of!(transcribe_backend_device, description) - 16usize];
["Offset of field: transcribe_backend_device::kind"]
[::std::mem::offset_of!(transcribe_backend_device, kind) - 24usize];
["Offset of field: transcribe_backend_device::device_id"]
[::std::mem::offset_of!(transcribe_backend_device, device_id) - 32usize];
["Offset of field: transcribe_backend_device::memory_total"]
[::std::mem::offset_of!(transcribe_backend_device, memory_total) - 40usize];
["Offset of field: transcribe_backend_device::memory_free"]
[::std::mem::offset_of!(transcribe_backend_device, memory_free) - 48usize];
["Offset of field: transcribe_backend_device::device_type"]
[::std::mem::offset_of!(transcribe_backend_device, device_type) - 56usize];
};
unsafe extern "C" {
pub fn transcribe_backend_device_init(p: *mut transcribe_backend_device);
}
unsafe extern "C" {
pub fn transcribe_get_backend_device(
index: ::std::os::raw::c_int,
out: *mut transcribe_backend_device,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_backend_available(kind: transcribe_backend_request) -> bool;
}
unsafe extern "C" {
pub fn transcribe_model_get_device(
model: *const transcribe_model,
out: *mut transcribe_backend_device,
) -> transcribe_status;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_model_load_params {
pub struct_size: u64,
pub backend: transcribe_backend_request,
pub gpu_device: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_model_load_params"]
[::std::mem::size_of::<transcribe_model_load_params>() - 16usize];
["Alignment of transcribe_model_load_params"]
[::std::mem::align_of::<transcribe_model_load_params>() - 8usize];
["Offset of field: transcribe_model_load_params::struct_size"]
[::std::mem::offset_of!(transcribe_model_load_params, struct_size) - 0usize];
["Offset of field: transcribe_model_load_params::backend"]
[::std::mem::offset_of!(transcribe_model_load_params, backend) - 8usize];
["Offset of field: transcribe_model_load_params::gpu_device"]
[::std::mem::offset_of!(transcribe_model_load_params, gpu_device) - 12usize];
};
unsafe extern "C" {
pub fn transcribe_model_load_params_init(params: *mut transcribe_model_load_params);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_session_params {
pub struct_size: u64,
pub n_threads: ::std::os::raw::c_int,
pub kv_type: transcribe_kv_type,
pub n_ctx: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_session_params"]
[::std::mem::size_of::<transcribe_session_params>() - 24usize];
["Alignment of transcribe_session_params"]
[::std::mem::align_of::<transcribe_session_params>() - 8usize];
["Offset of field: transcribe_session_params::struct_size"]
[::std::mem::offset_of!(transcribe_session_params, struct_size) - 0usize];
["Offset of field: transcribe_session_params::n_threads"]
[::std::mem::offset_of!(transcribe_session_params, n_threads) - 8usize];
["Offset of field: transcribe_session_params::kv_type"]
[::std::mem::offset_of!(transcribe_session_params, kv_type) - 12usize];
["Offset of field: transcribe_session_params::n_ctx"]
[::std::mem::offset_of!(transcribe_session_params, n_ctx) - 16usize];
};
unsafe extern "C" {
pub fn transcribe_session_params_init(params: *mut transcribe_session_params);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_run_params {
pub struct_size: u64,
pub task: transcribe_task,
pub timestamps: transcribe_timestamp_kind,
pub pnc: transcribe_pnc_mode,
pub itn: transcribe_itn_mode,
pub language: *const ::std::os::raw::c_char,
pub target_language: *const ::std::os::raw::c_char,
pub keep_special_tags: bool,
pub family: *const transcribe_ext,
pub spec_k_drafts: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_run_params"][::std::mem::size_of::<transcribe_run_params>() - 64usize];
["Alignment of transcribe_run_params"]
[::std::mem::align_of::<transcribe_run_params>() - 8usize];
["Offset of field: transcribe_run_params::struct_size"]
[::std::mem::offset_of!(transcribe_run_params, struct_size) - 0usize];
["Offset of field: transcribe_run_params::task"]
[::std::mem::offset_of!(transcribe_run_params, task) - 8usize];
["Offset of field: transcribe_run_params::timestamps"]
[::std::mem::offset_of!(transcribe_run_params, timestamps) - 12usize];
["Offset of field: transcribe_run_params::pnc"]
[::std::mem::offset_of!(transcribe_run_params, pnc) - 16usize];
["Offset of field: transcribe_run_params::itn"]
[::std::mem::offset_of!(transcribe_run_params, itn) - 20usize];
["Offset of field: transcribe_run_params::language"]
[::std::mem::offset_of!(transcribe_run_params, language) - 24usize];
["Offset of field: transcribe_run_params::target_language"]
[::std::mem::offset_of!(transcribe_run_params, target_language) - 32usize];
["Offset of field: transcribe_run_params::keep_special_tags"]
[::std::mem::offset_of!(transcribe_run_params, keep_special_tags) - 40usize];
["Offset of field: transcribe_run_params::family"]
[::std::mem::offset_of!(transcribe_run_params, family) - 48usize];
["Offset of field: transcribe_run_params::spec_k_drafts"]
[::std::mem::offset_of!(transcribe_run_params, spec_k_drafts) - 56usize];
};
unsafe extern "C" {
pub fn transcribe_run_params_init(params: *mut transcribe_run_params);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_capabilities {
pub struct_size: u64,
pub native_sample_rate: i32,
pub n_languages: ::std::os::raw::c_int,
pub languages: *const *const ::std::os::raw::c_char,
pub max_timestamp_kind: transcribe_timestamp_kind,
pub supports_language_detect: bool,
pub supports_translate: bool,
pub supports_streaming: bool,
pub supports_spec_decode: bool,
pub max_audio_ms: i64,
pub n_translate_target_languages: ::std::os::raw::c_int,
pub translate_target_languages: *const *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_capabilities"][::std::mem::size_of::<transcribe_capabilities>() - 56usize];
["Alignment of transcribe_capabilities"]
[::std::mem::align_of::<transcribe_capabilities>() - 8usize];
["Offset of field: transcribe_capabilities::struct_size"]
[::std::mem::offset_of!(transcribe_capabilities, struct_size) - 0usize];
["Offset of field: transcribe_capabilities::native_sample_rate"]
[::std::mem::offset_of!(transcribe_capabilities, native_sample_rate) - 8usize];
["Offset of field: transcribe_capabilities::n_languages"]
[::std::mem::offset_of!(transcribe_capabilities, n_languages) - 12usize];
["Offset of field: transcribe_capabilities::languages"]
[::std::mem::offset_of!(transcribe_capabilities, languages) - 16usize];
["Offset of field: transcribe_capabilities::max_timestamp_kind"]
[::std::mem::offset_of!(transcribe_capabilities, max_timestamp_kind) - 24usize];
["Offset of field: transcribe_capabilities::supports_language_detect"]
[::std::mem::offset_of!(transcribe_capabilities, supports_language_detect) - 28usize];
["Offset of field: transcribe_capabilities::supports_translate"]
[::std::mem::offset_of!(transcribe_capabilities, supports_translate) - 29usize];
["Offset of field: transcribe_capabilities::supports_streaming"]
[::std::mem::offset_of!(transcribe_capabilities, supports_streaming) - 30usize];
["Offset of field: transcribe_capabilities::supports_spec_decode"]
[::std::mem::offset_of!(transcribe_capabilities, supports_spec_decode) - 31usize];
["Offset of field: transcribe_capabilities::max_audio_ms"]
[::std::mem::offset_of!(transcribe_capabilities, max_audio_ms) - 32usize];
["Offset of field: transcribe_capabilities::n_translate_target_languages"]
[::std::mem::offset_of!(transcribe_capabilities, n_translate_target_languages) - 40usize];
["Offset of field: transcribe_capabilities::translate_target_languages"]
[::std::mem::offset_of!(transcribe_capabilities, translate_target_languages) - 48usize];
};
unsafe extern "C" {
pub fn transcribe_capabilities_init(out: *mut transcribe_capabilities);
}
unsafe extern "C" {
pub fn transcribe_model_get_capabilities(
model: *const transcribe_model,
out_caps: *mut transcribe_capabilities,
) -> transcribe_status;
}
impl transcribe_feature {
pub const TRANSCRIBE_FEATURE_INITIAL_PROMPT: transcribe_feature = transcribe_feature(0);
pub const TRANSCRIBE_FEATURE_TEMPERATURE_FALLBACK: transcribe_feature = transcribe_feature(1);
pub const TRANSCRIBE_FEATURE_LONG_FORM: transcribe_feature = transcribe_feature(2);
pub const TRANSCRIBE_FEATURE_CANCELLATION: transcribe_feature = transcribe_feature(3);
pub const TRANSCRIBE_FEATURE_PNC: transcribe_feature = transcribe_feature(4);
pub const TRANSCRIBE_FEATURE_ITN: transcribe_feature = transcribe_feature(5);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_feature(pub ::std::os::raw::c_uint);
unsafe extern "C" {
pub fn transcribe_model_supports(
model: *const transcribe_model,
feature: transcribe_feature,
) -> bool;
}
unsafe extern "C" {
pub fn transcribe_model_arch_string(
model: *const transcribe_model,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_model_variant_string(
model: *const transcribe_model,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_model_backend(
model: *const transcribe_model,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_model_meta_val_str(
model: *const transcribe_model,
key: *const ::std::os::raw::c_char,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_model_load_file(
path: *const ::std::os::raw::c_char,
params: *const transcribe_model_load_params,
out_model: *mut *mut transcribe_model,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_model_free(model: *mut transcribe_model);
}
unsafe extern "C" {
pub fn transcribe_session_init(
model: *mut transcribe_model,
params: *const transcribe_session_params,
out_session: *mut *mut transcribe_session,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_session_free(session: *mut transcribe_session);
}
unsafe extern "C" {
pub fn transcribe_open(
path: *const ::std::os::raw::c_char,
load_params: *const transcribe_model_load_params,
session_params: *const transcribe_session_params,
out_session: *mut *mut transcribe_session,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_close(session: *mut transcribe_session);
}
unsafe extern "C" {
pub fn transcribe_get_model(session: *const transcribe_session) -> *const transcribe_model;
}
unsafe extern "C" {
pub fn transcribe_run(
session: *mut transcribe_session,
pcm: *const f32,
n_samples: ::std::os::raw::c_int,
params: *const transcribe_run_params,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_run_batch(
session: *mut transcribe_session,
pcm: *const *const f32,
n_samples: *const ::std::os::raw::c_int,
n: ::std::os::raw::c_int,
params: *const transcribe_run_params,
) -> transcribe_status;
}
pub type transcribe_abort_callback =
::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void) -> bool>;
unsafe extern "C" {
pub fn transcribe_set_abort_callback(
session: *mut transcribe_session,
cb: transcribe_abort_callback,
user_data: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
pub fn transcribe_was_aborted(session: *const transcribe_session) -> bool;
}
unsafe extern "C" {
pub fn transcribe_was_truncated(session: *const transcribe_session) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_session_limits {
pub struct_size: u64,
pub effective_n_ctx: i32,
pub effective_max_audio_ms: i64,
pub max_kv_bytes: i64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_session_limits"]
[::std::mem::size_of::<transcribe_session_limits>() - 32usize];
["Alignment of transcribe_session_limits"]
[::std::mem::align_of::<transcribe_session_limits>() - 8usize];
["Offset of field: transcribe_session_limits::struct_size"]
[::std::mem::offset_of!(transcribe_session_limits, struct_size) - 0usize];
["Offset of field: transcribe_session_limits::effective_n_ctx"]
[::std::mem::offset_of!(transcribe_session_limits, effective_n_ctx) - 8usize];
["Offset of field: transcribe_session_limits::effective_max_audio_ms"]
[::std::mem::offset_of!(transcribe_session_limits, effective_max_audio_ms) - 16usize];
["Offset of field: transcribe_session_limits::max_kv_bytes"]
[::std::mem::offset_of!(transcribe_session_limits, max_kv_bytes) - 24usize];
};
unsafe extern "C" {
pub fn transcribe_session_limits_init(out: *mut transcribe_session_limits);
}
unsafe extern "C" {
pub fn transcribe_session_get_limits(
session: *const transcribe_session,
out: *mut transcribe_session_limits,
) -> transcribe_status;
}
impl transcribe_stream_state {
pub const TRANSCRIBE_STREAM_IDLE: transcribe_stream_state = transcribe_stream_state(0);
pub const TRANSCRIBE_STREAM_ACTIVE: transcribe_stream_state = transcribe_stream_state(1);
pub const TRANSCRIBE_STREAM_FINISHED: transcribe_stream_state = transcribe_stream_state(2);
pub const TRANSCRIBE_STREAM_FAILED: transcribe_stream_state = transcribe_stream_state(3);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_stream_state(pub ::std::os::raw::c_uint);
impl transcribe_stream_commit_policy {
pub const TRANSCRIBE_STREAM_COMMIT_AUTO: transcribe_stream_commit_policy =
transcribe_stream_commit_policy(0);
pub const TRANSCRIBE_STREAM_COMMIT_ON_FINALIZE: transcribe_stream_commit_policy =
transcribe_stream_commit_policy(1);
pub const TRANSCRIBE_STREAM_COMMIT_STABLE_PREFIX: transcribe_stream_commit_policy =
transcribe_stream_commit_policy(2);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_stream_commit_policy(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_stream_params {
pub struct_size: u64,
pub family: *const transcribe_ext,
pub commit_policy: transcribe_stream_commit_policy,
pub stable_prefix_agreement_n: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_stream_params"]
[::std::mem::size_of::<transcribe_stream_params>() - 24usize];
["Alignment of transcribe_stream_params"]
[::std::mem::align_of::<transcribe_stream_params>() - 8usize];
["Offset of field: transcribe_stream_params::struct_size"]
[::std::mem::offset_of!(transcribe_stream_params, struct_size) - 0usize];
["Offset of field: transcribe_stream_params::family"]
[::std::mem::offset_of!(transcribe_stream_params, family) - 8usize];
["Offset of field: transcribe_stream_params::commit_policy"]
[::std::mem::offset_of!(transcribe_stream_params, commit_policy) - 16usize];
["Offset of field: transcribe_stream_params::stable_prefix_agreement_n"]
[::std::mem::offset_of!(transcribe_stream_params, stable_prefix_agreement_n) - 20usize];
};
unsafe extern "C" {
pub fn transcribe_stream_params_init(params: *mut transcribe_stream_params);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_stream_update {
pub struct_size: u64,
pub result_changed: bool,
pub is_final: bool,
pub revision: i32,
pub input_received_ms: i64,
pub audio_committed_ms: i64,
pub buffered_ms: i64,
pub committed_changed: bool,
pub tentative_changed: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_stream_update"]
[::std::mem::size_of::<transcribe_stream_update>() - 48usize];
["Alignment of transcribe_stream_update"]
[::std::mem::align_of::<transcribe_stream_update>() - 8usize];
["Offset of field: transcribe_stream_update::struct_size"]
[::std::mem::offset_of!(transcribe_stream_update, struct_size) - 0usize];
["Offset of field: transcribe_stream_update::result_changed"]
[::std::mem::offset_of!(transcribe_stream_update, result_changed) - 8usize];
["Offset of field: transcribe_stream_update::is_final"]
[::std::mem::offset_of!(transcribe_stream_update, is_final) - 9usize];
["Offset of field: transcribe_stream_update::revision"]
[::std::mem::offset_of!(transcribe_stream_update, revision) - 12usize];
["Offset of field: transcribe_stream_update::input_received_ms"]
[::std::mem::offset_of!(transcribe_stream_update, input_received_ms) - 16usize];
["Offset of field: transcribe_stream_update::audio_committed_ms"]
[::std::mem::offset_of!(transcribe_stream_update, audio_committed_ms) - 24usize];
["Offset of field: transcribe_stream_update::buffered_ms"]
[::std::mem::offset_of!(transcribe_stream_update, buffered_ms) - 32usize];
["Offset of field: transcribe_stream_update::committed_changed"]
[::std::mem::offset_of!(transcribe_stream_update, committed_changed) - 40usize];
["Offset of field: transcribe_stream_update::tentative_changed"]
[::std::mem::offset_of!(transcribe_stream_update, tentative_changed) - 41usize];
};
unsafe extern "C" {
pub fn transcribe_stream_update_init(out: *mut transcribe_stream_update);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_stream_text {
pub struct_size: u64,
pub full_text: *const ::std::os::raw::c_char,
pub full_text_bytes: u64,
pub committed_text: *const ::std::os::raw::c_char,
pub committed_text_bytes: u64,
pub tentative_text: *const ::std::os::raw::c_char,
pub tentative_text_bytes: u64,
pub raw_tentative_start_bytes: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_stream_text"][::std::mem::size_of::<transcribe_stream_text>() - 64usize];
["Alignment of transcribe_stream_text"]
[::std::mem::align_of::<transcribe_stream_text>() - 8usize];
["Offset of field: transcribe_stream_text::struct_size"]
[::std::mem::offset_of!(transcribe_stream_text, struct_size) - 0usize];
["Offset of field: transcribe_stream_text::full_text"]
[::std::mem::offset_of!(transcribe_stream_text, full_text) - 8usize];
["Offset of field: transcribe_stream_text::full_text_bytes"]
[::std::mem::offset_of!(transcribe_stream_text, full_text_bytes) - 16usize];
["Offset of field: transcribe_stream_text::committed_text"]
[::std::mem::offset_of!(transcribe_stream_text, committed_text) - 24usize];
["Offset of field: transcribe_stream_text::committed_text_bytes"]
[::std::mem::offset_of!(transcribe_stream_text, committed_text_bytes) - 32usize];
["Offset of field: transcribe_stream_text::tentative_text"]
[::std::mem::offset_of!(transcribe_stream_text, tentative_text) - 40usize];
["Offset of field: transcribe_stream_text::tentative_text_bytes"]
[::std::mem::offset_of!(transcribe_stream_text, tentative_text_bytes) - 48usize];
["Offset of field: transcribe_stream_text::raw_tentative_start_bytes"]
[::std::mem::offset_of!(transcribe_stream_text, raw_tentative_start_bytes) - 56usize];
};
unsafe extern "C" {
pub fn transcribe_stream_text_init(out: *mut transcribe_stream_text);
}
unsafe extern "C" {
pub fn transcribe_stream_get_text(
session: *const transcribe_session,
out: *mut transcribe_stream_text,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_stream_begin(
session: *mut transcribe_session,
run_params: *const transcribe_run_params,
stream_params: *const transcribe_stream_params,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_stream_feed(
session: *mut transcribe_session,
pcm: *const f32,
n_samples: ::std::os::raw::c_int,
update: *mut transcribe_stream_update,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_stream_finalize(
session: *mut transcribe_session,
update: *mut transcribe_stream_update,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_stream_reset(session: *mut transcribe_session);
}
unsafe extern "C" {
pub fn transcribe_stream_get_state(
session: *const transcribe_session,
) -> transcribe_stream_state;
}
unsafe extern "C" {
pub fn transcribe_stream_revision(session: *const transcribe_session) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_stream_n_committed_segments(
session: *const transcribe_session,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_stream_n_committed_words(
session: *const transcribe_session,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_stream_n_committed_tokens(
session: *const transcribe_session,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_stream_last_status(session: *const transcribe_session) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_tokenize(
model: *const transcribe_model,
text: *const ::std::os::raw::c_char,
tokens: *mut i32,
n_max: usize,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_timings {
pub struct_size: u64,
pub load_ms: f32,
pub mel_ms: f32,
pub encode_ms: f32,
pub decode_ms: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_timings"][::std::mem::size_of::<transcribe_timings>() - 24usize];
["Alignment of transcribe_timings"][::std::mem::align_of::<transcribe_timings>() - 8usize];
["Offset of field: transcribe_timings::struct_size"]
[::std::mem::offset_of!(transcribe_timings, struct_size) - 0usize];
["Offset of field: transcribe_timings::load_ms"]
[::std::mem::offset_of!(transcribe_timings, load_ms) - 8usize];
["Offset of field: transcribe_timings::mel_ms"]
[::std::mem::offset_of!(transcribe_timings, mel_ms) - 12usize];
["Offset of field: transcribe_timings::encode_ms"]
[::std::mem::offset_of!(transcribe_timings, encode_ms) - 16usize];
["Offset of field: transcribe_timings::decode_ms"]
[::std::mem::offset_of!(transcribe_timings, decode_ms) - 20usize];
};
unsafe extern "C" {
pub fn transcribe_timings_init(out: *mut transcribe_timings);
}
unsafe extern "C" {
pub fn transcribe_get_timings(
session: *const transcribe_session,
out_timings: *mut transcribe_timings,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_print_timings(session: *const transcribe_session);
}
unsafe extern "C" {
pub fn transcribe_reset_timings(session: *mut transcribe_session);
}
unsafe extern "C" {
pub fn transcribe_full_text(
session: *const transcribe_session,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_returned_timestamp_kind(
session: *const transcribe_session,
) -> transcribe_timestamp_kind;
}
unsafe extern "C" {
pub fn transcribe_n_segments(session: *const transcribe_session) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_n_words(session: *const transcribe_session) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_n_tokens(session: *const transcribe_session) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_detected_language(
session: *const transcribe_session,
) -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_segment {
pub struct_size: u64,
pub t0_ms: i64,
pub t1_ms: i64,
pub first_word: ::std::os::raw::c_int,
pub n_words: ::std::os::raw::c_int,
pub first_token: ::std::os::raw::c_int,
pub n_tokens: ::std::os::raw::c_int,
pub text: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_segment"][::std::mem::size_of::<transcribe_segment>() - 48usize];
["Alignment of transcribe_segment"][::std::mem::align_of::<transcribe_segment>() - 8usize];
["Offset of field: transcribe_segment::struct_size"]
[::std::mem::offset_of!(transcribe_segment, struct_size) - 0usize];
["Offset of field: transcribe_segment::t0_ms"]
[::std::mem::offset_of!(transcribe_segment, t0_ms) - 8usize];
["Offset of field: transcribe_segment::t1_ms"]
[::std::mem::offset_of!(transcribe_segment, t1_ms) - 16usize];
["Offset of field: transcribe_segment::first_word"]
[::std::mem::offset_of!(transcribe_segment, first_word) - 24usize];
["Offset of field: transcribe_segment::n_words"]
[::std::mem::offset_of!(transcribe_segment, n_words) - 28usize];
["Offset of field: transcribe_segment::first_token"]
[::std::mem::offset_of!(transcribe_segment, first_token) - 32usize];
["Offset of field: transcribe_segment::n_tokens"]
[::std::mem::offset_of!(transcribe_segment, n_tokens) - 36usize];
["Offset of field: transcribe_segment::text"]
[::std::mem::offset_of!(transcribe_segment, text) - 40usize];
};
unsafe extern "C" {
pub fn transcribe_segment_init(out: *mut transcribe_segment);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_word {
pub struct_size: u64,
pub t0_ms: i64,
pub t1_ms: i64,
pub seg_index: ::std::os::raw::c_int,
pub first_token: ::std::os::raw::c_int,
pub n_tokens: ::std::os::raw::c_int,
pub text: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_word"][::std::mem::size_of::<transcribe_word>() - 48usize];
["Alignment of transcribe_word"][::std::mem::align_of::<transcribe_word>() - 8usize];
["Offset of field: transcribe_word::struct_size"]
[::std::mem::offset_of!(transcribe_word, struct_size) - 0usize];
["Offset of field: transcribe_word::t0_ms"]
[::std::mem::offset_of!(transcribe_word, t0_ms) - 8usize];
["Offset of field: transcribe_word::t1_ms"]
[::std::mem::offset_of!(transcribe_word, t1_ms) - 16usize];
["Offset of field: transcribe_word::seg_index"]
[::std::mem::offset_of!(transcribe_word, seg_index) - 24usize];
["Offset of field: transcribe_word::first_token"]
[::std::mem::offset_of!(transcribe_word, first_token) - 28usize];
["Offset of field: transcribe_word::n_tokens"]
[::std::mem::offset_of!(transcribe_word, n_tokens) - 32usize];
["Offset of field: transcribe_word::text"]
[::std::mem::offset_of!(transcribe_word, text) - 40usize];
};
unsafe extern "C" {
pub fn transcribe_word_init(out: *mut transcribe_word);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_token {
pub struct_size: u64,
pub id: ::std::os::raw::c_int,
pub p: f32,
pub t0_ms: i64,
pub t1_ms: i64,
pub seg_index: ::std::os::raw::c_int,
pub word_index: ::std::os::raw::c_int,
pub text: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_token"][::std::mem::size_of::<transcribe_token>() - 48usize];
["Alignment of transcribe_token"][::std::mem::align_of::<transcribe_token>() - 8usize];
["Offset of field: transcribe_token::struct_size"]
[::std::mem::offset_of!(transcribe_token, struct_size) - 0usize];
["Offset of field: transcribe_token::id"]
[::std::mem::offset_of!(transcribe_token, id) - 8usize];
["Offset of field: transcribe_token::p"][::std::mem::offset_of!(transcribe_token, p) - 12usize];
["Offset of field: transcribe_token::t0_ms"]
[::std::mem::offset_of!(transcribe_token, t0_ms) - 16usize];
["Offset of field: transcribe_token::t1_ms"]
[::std::mem::offset_of!(transcribe_token, t1_ms) - 24usize];
["Offset of field: transcribe_token::seg_index"]
[::std::mem::offset_of!(transcribe_token, seg_index) - 32usize];
["Offset of field: transcribe_token::word_index"]
[::std::mem::offset_of!(transcribe_token, word_index) - 36usize];
["Offset of field: transcribe_token::text"]
[::std::mem::offset_of!(transcribe_token, text) - 40usize];
};
unsafe extern "C" {
pub fn transcribe_token_init(out: *mut transcribe_token);
}
unsafe extern "C" {
pub fn transcribe_get_segment(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
out: *mut transcribe_segment,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_get_word(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
out: *mut transcribe_word,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_get_token(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
out: *mut transcribe_token,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_batch_n_results(session: *const transcribe_session) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_batch_status(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_batch_full_text(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_batch_returned_timestamp_kind(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> transcribe_timestamp_kind;
}
unsafe extern "C" {
pub fn transcribe_batch_detected_language(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn transcribe_batch_n_segments(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_batch_n_words(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_batch_n_tokens(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_batch_get_segment(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
j: ::std::os::raw::c_int,
out: *mut transcribe_segment,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_batch_get_word(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
j: ::std::os::raw::c_int,
out: *mut transcribe_word,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_batch_get_token(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
j: ::std::os::raw::c_int,
out: *mut transcribe_token,
) -> transcribe_status;
}
unsafe extern "C" {
pub fn transcribe_batch_get_timings(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
out: *mut transcribe_timings,
) -> transcribe_status;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_moonshine_streaming_stream_ext {
pub ext: transcribe_ext,
pub min_decode_interval_ms: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_moonshine_streaming_stream_ext"]
[::std::mem::size_of::<transcribe_moonshine_streaming_stream_ext>() - 24usize];
["Alignment of transcribe_moonshine_streaming_stream_ext"]
[::std::mem::align_of::<transcribe_moonshine_streaming_stream_ext>() - 8usize];
["Offset of field: transcribe_moonshine_streaming_stream_ext::ext"]
[::std::mem::offset_of!(transcribe_moonshine_streaming_stream_ext, ext) - 0usize];
["Offset of field: transcribe_moonshine_streaming_stream_ext::min_decode_interval_ms"][::std::mem::offset_of!(
transcribe_moonshine_streaming_stream_ext,
min_decode_interval_ms
)
- 16usize];
};
unsafe extern "C" {
pub fn transcribe_moonshine_streaming_stream_ext_init(
ext: *mut transcribe_moonshine_streaming_stream_ext,
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_parakeet_stream_ext {
pub ext: transcribe_ext,
pub att_context_right: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_parakeet_stream_ext"]
[::std::mem::size_of::<transcribe_parakeet_stream_ext>() - 24usize];
["Alignment of transcribe_parakeet_stream_ext"]
[::std::mem::align_of::<transcribe_parakeet_stream_ext>() - 8usize];
["Offset of field: transcribe_parakeet_stream_ext::ext"]
[::std::mem::offset_of!(transcribe_parakeet_stream_ext, ext) - 0usize];
["Offset of field: transcribe_parakeet_stream_ext::att_context_right"]
[::std::mem::offset_of!(transcribe_parakeet_stream_ext, att_context_right) - 16usize];
};
unsafe extern "C" {
pub fn transcribe_parakeet_stream_ext_init(ext: *mut transcribe_parakeet_stream_ext);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_parakeet_buffered_stream_ext {
pub ext: transcribe_ext,
pub left_ms: i32,
pub chunk_ms: i32,
pub right_ms: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_parakeet_buffered_stream_ext"]
[::std::mem::size_of::<transcribe_parakeet_buffered_stream_ext>() - 32usize];
["Alignment of transcribe_parakeet_buffered_stream_ext"]
[::std::mem::align_of::<transcribe_parakeet_buffered_stream_ext>() - 8usize];
["Offset of field: transcribe_parakeet_buffered_stream_ext::ext"]
[::std::mem::offset_of!(transcribe_parakeet_buffered_stream_ext, ext) - 0usize];
["Offset of field: transcribe_parakeet_buffered_stream_ext::left_ms"]
[::std::mem::offset_of!(transcribe_parakeet_buffered_stream_ext, left_ms) - 16usize];
["Offset of field: transcribe_parakeet_buffered_stream_ext::chunk_ms"]
[::std::mem::offset_of!(transcribe_parakeet_buffered_stream_ext, chunk_ms) - 20usize];
["Offset of field: transcribe_parakeet_buffered_stream_ext::right_ms"]
[::std::mem::offset_of!(transcribe_parakeet_buffered_stream_ext, right_ms) - 24usize];
};
unsafe extern "C" {
pub fn transcribe_parakeet_buffered_stream_ext_init(
ext: *mut transcribe_parakeet_buffered_stream_ext,
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_voxtral_realtime_stream_ext {
pub ext: transcribe_ext,
pub num_delay_tokens: i32,
pub min_decode_interval_ms: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_voxtral_realtime_stream_ext"]
[::std::mem::size_of::<transcribe_voxtral_realtime_stream_ext>() - 24usize];
["Alignment of transcribe_voxtral_realtime_stream_ext"]
[::std::mem::align_of::<transcribe_voxtral_realtime_stream_ext>() - 8usize];
["Offset of field: transcribe_voxtral_realtime_stream_ext::ext"]
[::std::mem::offset_of!(transcribe_voxtral_realtime_stream_ext, ext) - 0usize];
["Offset of field: transcribe_voxtral_realtime_stream_ext::num_delay_tokens"][::std::mem::offset_of!(
transcribe_voxtral_realtime_stream_ext,
num_delay_tokens
) - 16usize];
["Offset of field: transcribe_voxtral_realtime_stream_ext::min_decode_interval_ms"][::std::mem::offset_of!(
transcribe_voxtral_realtime_stream_ext,
min_decode_interval_ms
)
- 20usize];
};
unsafe extern "C" {
pub fn transcribe_voxtral_realtime_stream_ext_init(
ext: *mut transcribe_voxtral_realtime_stream_ext,
);
}
impl transcribe_whisper_prompt_condition {
pub const TRANSCRIBE_WHISPER_PROMPT_FIRST_SEGMENT: transcribe_whisper_prompt_condition =
transcribe_whisper_prompt_condition(0);
pub const TRANSCRIBE_WHISPER_PROMPT_ALL_SEGMENTS: transcribe_whisper_prompt_condition =
transcribe_whisper_prompt_condition(1);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct transcribe_whisper_prompt_condition(pub ::std::os::raw::c_uint);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_whisper_run_ext {
pub ext: transcribe_ext,
pub initial_prompt: *const ::std::os::raw::c_char,
pub prompt_tokens: *const i32,
pub n_prompt_tokens: usize,
pub prompt_condition: transcribe_whisper_prompt_condition,
pub condition_on_prev_tokens: bool,
pub max_prev_context_tokens: i32,
pub temperature: f32,
pub temperature_inc: f32,
pub compression_ratio_thold: f32,
pub logprob_thold: f32,
pub no_speech_thold: f32,
pub seed: u32,
pub max_initial_timestamp: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_whisper_run_ext"]
[::std::mem::size_of::<transcribe_whisper_run_ext>() - 80usize];
["Alignment of transcribe_whisper_run_ext"]
[::std::mem::align_of::<transcribe_whisper_run_ext>() - 8usize];
["Offset of field: transcribe_whisper_run_ext::ext"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, ext) - 0usize];
["Offset of field: transcribe_whisper_run_ext::initial_prompt"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, initial_prompt) - 16usize];
["Offset of field: transcribe_whisper_run_ext::prompt_tokens"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, prompt_tokens) - 24usize];
["Offset of field: transcribe_whisper_run_ext::n_prompt_tokens"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, n_prompt_tokens) - 32usize];
["Offset of field: transcribe_whisper_run_ext::prompt_condition"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, prompt_condition) - 40usize];
["Offset of field: transcribe_whisper_run_ext::condition_on_prev_tokens"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, condition_on_prev_tokens) - 44usize];
["Offset of field: transcribe_whisper_run_ext::max_prev_context_tokens"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, max_prev_context_tokens) - 48usize];
["Offset of field: transcribe_whisper_run_ext::temperature"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, temperature) - 52usize];
["Offset of field: transcribe_whisper_run_ext::temperature_inc"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, temperature_inc) - 56usize];
["Offset of field: transcribe_whisper_run_ext::compression_ratio_thold"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, compression_ratio_thold) - 60usize];
["Offset of field: transcribe_whisper_run_ext::logprob_thold"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, logprob_thold) - 64usize];
["Offset of field: transcribe_whisper_run_ext::no_speech_thold"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, no_speech_thold) - 68usize];
["Offset of field: transcribe_whisper_run_ext::seed"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, seed) - 72usize];
["Offset of field: transcribe_whisper_run_ext::max_initial_timestamp"]
[::std::mem::offset_of!(transcribe_whisper_run_ext, max_initial_timestamp) - 76usize];
};
unsafe extern "C" {
pub fn transcribe_whisper_run_ext_init(ext: *mut transcribe_whisper_run_ext);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct transcribe_whisper_chunk_trace {
pub struct_size: u64,
pub t0_ms: i64,
pub t1_ms: i64,
pub temperature_used: f32,
pub compression_ratio: f32,
pub avg_logprob: f32,
pub no_speech_prob: f32,
pub no_speech_triggered: bool,
pub n_fallbacks: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of transcribe_whisper_chunk_trace"]
[::std::mem::size_of::<transcribe_whisper_chunk_trace>() - 48usize];
["Alignment of transcribe_whisper_chunk_trace"]
[::std::mem::align_of::<transcribe_whisper_chunk_trace>() - 8usize];
["Offset of field: transcribe_whisper_chunk_trace::struct_size"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, struct_size) - 0usize];
["Offset of field: transcribe_whisper_chunk_trace::t0_ms"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, t0_ms) - 8usize];
["Offset of field: transcribe_whisper_chunk_trace::t1_ms"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, t1_ms) - 16usize];
["Offset of field: transcribe_whisper_chunk_trace::temperature_used"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, temperature_used) - 24usize];
["Offset of field: transcribe_whisper_chunk_trace::compression_ratio"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, compression_ratio) - 28usize];
["Offset of field: transcribe_whisper_chunk_trace::avg_logprob"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, avg_logprob) - 32usize];
["Offset of field: transcribe_whisper_chunk_trace::no_speech_prob"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, no_speech_prob) - 36usize];
["Offset of field: transcribe_whisper_chunk_trace::no_speech_triggered"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, no_speech_triggered) - 40usize];
["Offset of field: transcribe_whisper_chunk_trace::n_fallbacks"]
[::std::mem::offset_of!(transcribe_whisper_chunk_trace, n_fallbacks) - 44usize];
};
unsafe extern "C" {
pub fn transcribe_whisper_chunk_trace_init(out: *mut transcribe_whisper_chunk_trace);
}
unsafe extern "C" {
pub fn transcribe_get_whisper_chunk_count(
session: *const transcribe_session,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn transcribe_get_whisper_chunk_trace(
session: *const transcribe_session,
i: ::std::os::raw::c_int,
out_trace: *mut transcribe_whisper_chunk_trace,
) -> transcribe_status;
}