# `Codex.Voice.Input`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/voice/input.ex#L1)

Audio input types for voice pipelines.

This module provides two types of audio input:

- `AudioInput` - A complete, static audio buffer
- `StreamedAudioInput` - A streaming audio input that can be appended to

Both types support the standard PCM16 format at 24kHz, which is the default
format for OpenAI's voice APIs.

## Examples

    # Static audio input
    data = File.read!("recording.pcm")
    input = AudioInput.new(data)
    base64 = AudioInput.to_base64(input)

    # Streaming audio input
    input = StreamedAudioInput.new()
    spawn(fn ->
      Enum.each(chunks, &StreamedAudioInput.add(input, &1))
      StreamedAudioInput.close(input)
    end)
    for chunk <- StreamedAudioInput.stream(input) do
      process(chunk)
    end

---

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