Imp.Adapter.Types.Audio (Imp v0.5.0)

Copy Markdown View Source

An inert audio value backed by in-memory base64 data.

Use from_path/1 or from_url/2 for explicit eager I/O. Remote loading has the same SSRF responsibility described by Imp.Adapter.Types.Image.from_url/2.

Summary

Functions

Reads a trusted local audio file immediately into an inert value.

Downloads an HTTP(S) audio resource immediately into an inert value.

Types

t()

@type t() :: %Imp.Adapter.Types.Audio{
  data: term(),
  metadata: term(),
  mime_type: term(),
  url: term()
}

Functions

from_path(path)

Reads a trusted local audio file immediately into an inert value.

from_url(url, opts \\ [])

Downloads an HTTP(S) audio resource immediately into an inert value.

Options include :timeout in milliseconds (default 30_000). :request may inject an arity-2 transport for deterministic tests.