enum RemiAudio::Formats::WavEncoding

Overview

The supported encodings for a RIFF WAVE file.

Defined in:

remiaudio/formats/wav.cr

Enum Members

Lpcm = 1

Linear PCM samples.

Float = 3

IEEE floating point samples.

ALaw = 6

ALaw encoded samples.

MuLaw = 7

µLaw encoded samples.

Constructors

Instance Method Summary

Constructor Detail

def self.from_value(value : Int) : self #

[View source]

Instance Method Detail

def a_law? #

[View source]
def checkArray(array : SampleData, bitDepth : Int) : Bool #

Checks that array is the correct type for this encoding. If it is, this returns true, otherwise it returns false.


[View source]
def float? #

[View source]
def getByteSize(bitDepth : Int) : Int32 #

Returns the size in bytes for a single sample using this encoding.


[View source]
def getFloat32Div(bitDepth : Int) : Float32 #

Returns the value to use when converting a value in this encoding to a ::Float32. This will raise an UnsupportedEncodingError if converting from this encoding is not supported.


[View source]
def getFloat32Div?(bitDepth : Int) : Float32 | Nil #

Returns the value to use when converting a value in this encoding to a ::Float32, or nil if converting from this encoding is not supported.


[View source]
def getFloat64Div(bitDepth : Int) : Float64 #

Returns the value to use when converting a value in this encoding to a ::Float64. This will raise an UnsupportedEncodingError if converting from this encoding is not supported.


[View source]
def getFloat64Div?(bitDepth : Int) : Float64 | Nil #

Returns the value to use when converting a value in this encoding to a ::Float64, or nil if converting from this encoding is not supported.


[View source]
def lpcm? #

[View source]
def makeArray(size : Int32, bitDepth : Int) : SampleData #

Creates a new array of the given size that is appropriate for this encoding.


[View source]
def mu_law? #

[View source]
def toSampleFormat(bitDepth : Int) : SampleFormat #

Gets the SampleFormat that describes this encoding. If this is an encoding that does not describe a PCM/Float encoding, or an encoding not directly supported by RemiAudio, this raises a RemiAudioError.


[View source]
def toSampleFormat?(bitDepth : Int) : SampleFormat | Nil #

Attempts to get the SampleFormat that describes this encoding, or nil if it's a non PCM/Float encoding, or an encoding not directly supported by RemiAudio.


[View source]