Membrane Element: Lame v0.1.0 Membrane.Element.Lame.Encoder.Native View Source

This module is an interface to native lame encoder.

Link to this section Summary

Link to this section Functions

Link to this function create(channel, bitrate, quality) View Source
create(integer(), integer(), atom()) ::
  {:ok, any()}
  | {:error, {:args, atom(), String.t()}}
  | {:error, {:internal, atom()}}

Creates encoder.

It accepts three arguments:

  • number of channels
  • bitrate
  • quality

On success, returns {:ok, resource}.

On bad arguments passed, returns {:error, {:args, field, description}}.

On encoder initialization error, returns {:error, {:internal, reason}}.

Link to this function destroy(encoder) View Source
destroy(any()) ::
  :ok | {:error, {:args, atom(), String.t()}} | {:error, {:internal, atom()}}

Destroys the encoder.

It accepts one argument:

  • resource - encoder resource.

On success, returns :ok.

On bad arguments passed, returns {:error, {:args, field, description}}.

On internal error, returns {:error, {:internal, reason}}.

Link to this function encode_frame(encoder, buffer) View Source
encode_frame(any(), bitstring()) ::
  {:ok, bitstring()}
  | {:error, {:args, atom(), String.t()}}
  | {:error, {:internal, atom()}}

Encodes buffer.

It accepts two arguments:

  • resource - encoder resource,
  • data - bitstring to be encoded.

On success, returns {:ok, data} where data always contain one sample in the same format and channels as given to create/3.

On bad arguments passed, returns {:error, {:args, field, description}}.

On internal error, returns {:error, {:internal, reason}}.