class Opus::Encoder

Defined in:

opus-crystal/encoder.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(sample_rate : Int32, frame_size : Int32, channels : Int32) #

Allocates memory for new encoder and initialize it.


[View source]

Instance Method Detail

def bitrate=(value : Int32) : Int32 #

Configure bitrate.


[View source]
def encode(data : Slice(Number)) : Bytes #

Encodes data.


[View source]
def finalize : Nil #

Cleans up memory after encoder.


[View source]
def input_length : Int32 #

Returns size of data which should be provided to #encode method in bytes.


[View source]
def reset : Nil #

Resets the codec state.


[View source]
def vbr_rate=(value : Int32) : Int32 #

Enables variable bitrate for encoder.


[View source]