fn build_buffer(lower_value: usize, upper_value: usize) -> Vec<i16> {
        let mut buffer: Vec<i16> = Vec::new();
        for index in lower_value..upper_value {
            let value = (index as f64 / SAMPLE_RATE as f64 * f64::from(i16::MAX)) as i16;
            buffer.push(value as i16);
            buffer.push(-(value as i16)); // second channel <= opposite value
        }
        buffer
    }
// Build a buffer with 2 channels in the specified range
// which would be rendered as a diagonal on a Waveform image
// from left top corner to right bottom of the target image
// if all samples are rendered in the range [0:SAMPLE_RATE]
Build a buffer with 2 channels in the specified range
which would be rendered as a diagonal on a Waveform image
from left top corner to right bottom of the target image
if all samples are rendered in the range [0:SAMPLE_RATE]
Build a buffer with 2 channels in the specified range which would be rendered as a diagonal on a Waveform image from left top corner to right bottom of the target image if all samples are rendered in the range [ 0 : SAMPLE_RATE ]
fn build_buffer(lower_value: usize, upper_value: usize) -> Vec<i16> {
        let mut buffer: Vec<i16> = Vec::new();
        for index in lower_value..upper_value {
            let value = (index as f64 / SAMPLE_RATE as f64 * f64::from(i16::MAX)) as i16;
            buffer.push(value as i16);
            buffer.push(-(value as i16)); // second channel <= opposite value
        }
        buffer
    }
fn build_buffer ( lower_value : usize , upper_value : usize ) -> Vec < i16 > { let mut buffer : Vec < i16 > = Vec :: new ( ) ; for index in lower_value .. upper_value { let value = ( index as f64 / SAMPLE_RATE as f64 * f64 :: from ( i16 :: MAX ) ) as i16 ; buffer . push ( value as i16 ) ; buffer . push ( - ( value as i16 ) ) ; // second channel <= opposite value } buffer }
Build a buffer with 2 channels in the specified range
which would be rendered as a diagonal on a Waveform image
from left top corner to right bottom of the target image
if all samples are rendered in the range [0:SAMPLE_RATE]
Build a buffer with 2 channels in the specified range which would be rendered as a diagonal on a Waveform image from left top corner to right bottom of the target image if all samples are rendered in the range [ 0 : SAMPLE_RATE ]
lower_value
usize
upper_value
usize
lower_value
usize
upper_value
usize