Parlora.AudioFrame (Parlora v0.1.0)

Copy Markdown View Source

An ordered audio fragment. Locally derived timestamps are explicitly labeled.

Summary

Types

clock()

@type clock() :: :local_monotonic | :provider | :unknown

t()

@type t() :: %Parlora.AudioFrame{
  clock: clock(),
  data: binary(),
  discontinuity: boolean(),
  duration_us: non_neg_integer(),
  format: Parlora.AudioFormat.t(),
  generation: non_neg_integer(),
  playback_epoch: non_neg_integer() | nil,
  sequence: non_neg_integer(),
  stream_id: String.t(),
  timestamp_us: integer() | nil
}

Functions

new(data, format, stream_id, sequence, options \\ [])

pcm(data, stream_id, sequence, options \\ [])

@spec pcm(binary(), String.t(), non_neg_integer(), keyword()) :: t()

validate(frame, format, limits)

@spec validate(term(), Parlora.AudioFormat.t(), Parlora.Limits.t()) ::
  :ok | {:error, Parlora.Error.t()}