# `WhisperCpp.Native`
[🔗](https://github.com/rubas/whisper_cpp/blob/v0.2.0/lib/whisper_cpp/native.ex#L1)

Low-level Rustler bindings to whisper.cpp via the `whisper-rs` crate.

This module is private to the library. Use `WhisperCpp` for the public
API. Stub names must match the Rust NIF symbols verbatim (Rustler
verifies arity at module load time); user-friendly wrappers live below
them.

# `abort_handle_aborted?`

```elixir
@spec abort_handle_aborted?(reference()) :: boolean()
```

Returns `true` once an abort handle has been signalled.

# `abort_handle_signal`

```elixir
@spec abort_handle_signal(reference()) :: :ok
```

Signals an abort handle; in-flight transcribes observing it return early.

# `available_devices`

```elixir
@spec available_devices() :: {:ok, map()} | {:error, map()}
```

Reports the active runtime backends compiled into this NIF artefact.

# `load_model`

```elixir
@spec load_model(String.t(), map()) :: {:ok, reference()} | {:error, map()}
```

Loads a GGUF/GGML whisper.cpp model file.

# `model_info`

```elixir
@spec model_info(reference()) :: {:ok, map()} | {:error, map()}
```

Returns loaded-model metadata.

# `new_abort_handle`

```elixir
@spec new_abort_handle() :: reference()
```

Mints a fresh cooperative-cancellation handle.

# `transcribe`

```elixir
@spec transcribe(reference(), binary(), map(), reference() | nil, pid() | nil) ::
  {:ok, map()} | {:error, map()}
```

Runs whisper.cpp on a buffer of PCM samples.

`samples_bin` is a binary of little-endian `f32` mono samples at 16 kHz.
`abort_handle` is either `nil` or an opaque resource minted by
`new_abort_handle/0`; signalling it from another process cancels
in-flight inference. `progress_pid` is `nil` or a pid that receives
`{:whisper_progress, percent}` messages as work advances.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
