# `WhisperCt2.Native`
[🔗](https://github.com/rubas/whisper_ct2/blob/v0.5.0/lib/whisper_ct2/native.ex#L1)

Low-level Rustler bindings to `ct2rs::sys::Whisper`.

This module is private to the library. Use `WhisperCt2` 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.

# `available_devices`

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

CPU/CUDA device counts and the build's CUDA-support flag.

# `load_model`

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

Loads a CT2 Whisper model directory.

# `model_info`

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

Returns model metadata.

# `transcribe`

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

Runs Whisper on a buffer of PCM samples.

`samples_bin` is a binary of little-endian `f32` samples (mono, 16 kHz).
Audio longer than the 30 s Whisper window is chunked and batched
internally; the encoder runs once across all chunks. Returns a structured
transcription map (`%{language, duration_s, segments: [...]}`).

# `transcribe_batch`

```elixir
@spec transcribe_batch(reference(), [binary()], map()) ::
  {:ok, [map()]} | {:error, map()}
```

Runs Whisper on a list of PCM sample buffers in one batched `generate`
call. Returns a list of structured transcription maps in input order.

---

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