/// Constructs a `FloatWaveform` from an already-decoded vector of 32-bit float samples.
///
/// # Examples
///
/// This creates a `FloatWaveform` containing one second of silent *stereo* audio.
/// Note that the input vector contains 88,200 audio samples--which we divide into
/// 44,100 frames containing two samples each.
/// ```
/// use babycat::{FloatWaveform, Waveform};
///
/// let frame_rate_hz = 44100;
/// let num_channels = 2;
/// let raw_uncompressed_audio: Vec<f32> = vec![0.0_f32; 88200];
/// let waveform = FloatWaveform::new(frame_rate_hz, num_channels, raw_uncompressed_audio);
/// assert_eq!(
///     format!("{:?}", waveform),
///     "FloatWaveform { frame_rate_hz: 44100, num_channels: 2, num_frames: 44100}"
/// );
/// ```
///
Constructs a `FloatWaveform` from an already-decoded vector of 32-bit float samples.
Constructs a ` FloatWaveform ` from an already - decoded vector of 32 - bit float samples .
fn new(frame_rate_hz: u32, num_channels: u32, interleaved_samples: Vec<f32>) -> Self {
        let num_frames = interleaved_samples.len() as u64 / num_channels as u64;
        FloatWaveform {
            interleaved_samples,
            frame_rate_hz,
            num_channels,
            num_frames,
        }
    }
fn new ( frame_rate_hz : u32 , num_channels : u32 , interleaved_samples : Vec < f32 > ) -> Self { let num_frames = interleaved_samples . len ( ) as u64 / num_channels as u64 ; FloatWaveform { interleaved_samples , frame_rate_hz , num_channels , num_frames , } }
Constructs a `FloatWaveform` from an already-decoded vector of 32-bit float samples.
Constructs a ` FloatWaveform ` from an already - decoded vector of 32 - bit float samples .
frame_rate_hz
u32
num_channels
u32
interleaved_samples
Vec<f32>
examples
This creates a `FloatWaveform` containing one second of silent *stereo* audio.
Note that the input vector contains 88,200 audio samples--which we divide into
44,100 frames containing two samples each.
```
use babycat::{FloatWaveform, Waveform}.

let frame_rate_hz = 44100;
let num_channels = 2;
let raw_uncompressed_audio: Vec = vec![0.0_f32; 88200];
let waveform = FloatWaveform::new(frame_rate_hz, num_channels, raw_uncompressed_audio);
assert_eq!(
format!("{:?}", waveform),
"FloatWaveform { frame_rate_hz: 44100, num_channels: 2, num_frames: 44100}"
);
```
This creates a ` FloatWaveform ` containing one second of silent * stereo * audio . Note that the input vector contains 88 200 audio samples -- which we divide into 44 100 frames containing two samples each . ` ` ` use babycat :: { FloatWaveform Waveform } . let frame_rate_hz = 44100 ; let num_channels = 2 ; let raw_uncompressed_audio : Vec = vec! [ 0 . 0_f32 ; 88200 ] ; let waveform = FloatWaveform :: new ( frame_rate_hz num_channels raw_uncompressed_audio ) ; assert_eq! ( format! ( " { : ? } " waveform ) " FloatWaveform { frame_rate_hz : 44100 num_channels : 2 num_frames : 44100 } " ) ; ` ` `