class Sounding::Sound(T)

Overview

############################# main Sound class #############################

Defined in:

sounding.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(samples : Slice, info : LibSndFile::SFInfo) #

[View source]

Class Method Detail

def self.from_file(filepath : String, type : Class = Int32) #

create new Sound object from file


[View source]
def self.from_slice(slice : Slice, sr : T, n_channels = 2) #

create new Sound object from slice


[View source]

Instance Method Detail

def +(sound : Sound) #

superimposition


[View source]
def <<(sound : Sound) #

concatenation


[View source]
def add_slices(slc1 : Slice(T), slc2 : Slice(T)) #

sum two slices


[View source]
def change_slice_type(input : Slice, type : Class) #

change type of slice


[View source]
def channels #

[View source]
def concatenate_slices(slc1 : Slice(T), slc2 : Slice(T)) #

concatenate 2 slices


[View source]
def each(&) #

[View source]
def format #

[View source]
def frames #

SFInfo parameters


[View source]
def info #

[View source]
def rubberband(args : Array(String)) #

################################### rubberband-based operations ###################################


[View source]
def samplerate #

samplerate, in Hz


[View source]
def samplerate=(new_sr : T) #

set sample rate and resample the sound object


[View source]
def samples #

[View source]
def samples=(slice : Slice(T)) #

[View source]
def sections #

[View source]
def seekable #

[View source]
def shift_by_ms(time : Float64 | Float32 | T) #

[View source]
def shift_by_samples(samplecount : T) #

######################################### position operations, i guess #########################################


[View source]
def shift_by_sec(time : Float64 | Float32) #

[View source]
def shift_pitch(semitones : Float64 | Float32 | Int64 | T, preserve_formants : Bool = false) #

[View source]
def to_mono #

######################################### channel operations #########################################


[View source]
def write(filepath : String) #

write sound object to file


[View source]