struct RemiAudio::Formats::SampleInfo

Overview

The SampleInfo structure is used to get various information about the samples in an AudioFile.

Defined in:

remiaudio/formats/sampleinfo.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from(filename : String | Path) : SampleInfo #

Attempts to determine the format of filename, then creates a new SampleInfo instance containing the information for that file.

If this cannot determine the format, it will raise a FormatError.


[View source]
def self.fromAu(filename : String | Path) : SampleInfo #

Creates a new SampleInfo instance containing the information for the given Au file.


[View source]
def self.fromWav(filename : String | Path) : SampleInfo #

Creates a new SampleInfo instance containing the information for the given RIFF WAVE file.


[View source]
def self.new(aud : AudioFile) #

Creates a new SampleInfo by reading the currently available samples in aud


[View source]

Instance Method Detail

def bitDepth : UInt32 #

The bit depth of the source audio.


[View source]
def max : Float64 #

The maximum sample value, as a ::Float64 sample values. This is the maximum among all channels.


[View source]
def maxPerChan : Array(Float64) #

The maximum sample value, as a ::Float64 sample values, for each channel.


[View source]
def min : Float64 #

The minimum sample value, as a ::Float64 sample values.


[View source]
def minPerChan : Array(Float64) #

The minimum sample value, as a ::Float64 sample values, for each channel.


[View source]
def numSamples : UInt64 #

The total number of samples across all channels.


[View source]
def peak : Float64 #

The peak amplitude of this file, in decibels. This is the peak among all channels.


[View source]
def peakPerChan : Array(Float64) #

The peak amplitude of this file per channel, in decibels.


[View source]
def rms : Float64 #

The average (RMS) amplitude of this file, in decibels. This is the average between all channels.


[View source]
def rmsPerChan : Array(Float64) #

The average (RMS) amplitude of this file for each channel, in decibels.


[View source]
def sampleRate : UInt32 #

The sample rate of the source audio.


[View source]
def samplesPerChan : UInt64 #

The total number of samples per channels.


[View source]