Struct sonogram::Spectrogram

source ·
pub struct Spectrogram { /* private fields */ }

Implementations§

Save the calculated spectrogram as a PNG image.

Arguments
  • fname - The path to the PNG to save to the filesystem.
  • freq_scale - The type of frequency scale to use for the spectrogram.
  • gradient - The colour gradient to use for the spectrogram.
  • w_img - The output image width.
  • h_img - The output image height.

Create the spectrogram in memory as a PNG.

Arguments
  • freq_scale - The type of frequency scale to use for the spectrogram.
  • gradient - The colour gradient to use for the spectrogram.
  • w_img - The output image width.
  • h_img - The output image height.

Create the spectrogram in memory as raw RGBA format.

Arguments
  • freq_scale - The type of frequency scale to use for the spectrogram.
  • gradient - The colour gradient to use for the spectrogram.
  • w_img - The output image width.
  • h_img - The output image height.

Save the calculated spectrogram as a CSV file.

Arguments
  • fname - The path to the CSV to save to the filesystem.
  • freq_scale - The type of frequency scale to use for the spectrogram.
  • cols - The number of columns.
  • rows - The number of rows.

Map the spectrogram to the output buffer. Essentially scales the frequency to map to the vertical axis (y-axis) of the output and scale the x-axis to match the output. It will also convert the spectrogram to dB.

Arguments
  • freq_scale - The type of frequency scale to use for the spectrogram.
  • img_width - The output image width.
  • img_height - The output image height.

Get the minimum and maximum values from the current spectrogram.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.