class DFL::Sound

Overview

A DFL::Head's sound data

Included Modules

Defined in:

D_File/dfl/sound.cr
write.cr

Constant Summary

CHANNELS = 1_u16

The number of channels in the dfl sound

Constructors

Instance Method Summary

Instance methods inherited from module WritingMethods::DFL::Sound

write(io : IO) write

Constructor Detail

def self.from_wav(filename : String | Path) : Sound #

Reads in a dfl sound from a wav given the file path


[View source]
def self.from_wav(io : IO) : Sound #

Reads in a dfl sound from a wav given the io


[View source]
def self.read(io : IO) : Sound #

Reads in a dfl sound given the io


[View source]

Instance Method Detail

def bits_per_sample : UInt16 #

The number of bits per each sample


[View source]
def bits_per_sample=(bits_per_sample : UInt16) #

The number of bits per each sample


[View source]
def sample_rate : UInt32 #

The sample rate of the sound


[View source]
def sample_rate=(sample_rate : UInt32) #

The sample rate of the sound


[View source]
def samples : Array(UInt8 | UInt16) #

The samples


[View source]
def samples=(samples : Array(UInt8 | UInt16)) #

The samples


[View source]
def samples_num : UInt32 #

The number of samples in the sound


[View source]
def samples_num=(samples_num : UInt32) #

The number of samples in the sound


[View source]
def to_wav(filename : String | Path) : UInt32 #

Writes a dfl sound to a wav given the file path


[View source]
def to_wav(io : IO) : UInt32 #

Writes a dfl sound to a wav given the io


[View source]