fn output_sample(&mut self, sample: Sample) {

        self.buffer[self.position] = sample;

        self.position += 1;

        if self.position == self.buffer.len() {
            // Buffer filled, send it over and reset the position
            if let Err(e) = self.output.try_send(self.buffer) {
                match e {
                    TrySendError::Full(_) =>
                        error!("Sound channel is full, dropping {} samples",
                               self.buffer.len()),
                    e => panic!("Couldn't send audio buffer: {:?}", e),
                }
            }

            self.position = 0;
        }
    }
/// Handle sample buffering and sending them through the
/// asynchronous channel.
Handle sample buffering and sending them through the
asynchronous channel.
Handle sample buffering and sending them through the asynchronous channel .
fn output_sample(&mut self, sample: Sample) {
        self.buffer[self.position] = sample;
        self.position += 1;
        if self.position == self.buffer.len() {
            // Buffer filled, send it over and reset the position
            if let Err(e) = self.output.try_send(self.buffer) {
                match e {
                    TrySendError::Full(_) =>
                        error!("Sound channel is full, dropping {} samples",
                               self.buffer.len()),
                    e => panic!("Couldn't send audio buffer: {:?}", e),
                }
            }
            self.position = 0;
        }
    }
fn output_sample ( & mut self , sample : Sample ) { self . buffer [ self . position ] = sample ; self . position += 1 ; if self . position == self . buffer . len ( ) { // Buffer filled, send it over and reset the position if let Err ( e ) = self . output . try_send ( self . buffer ) { match e { TrySendError :: Full ( _ ) => error ! ( " " self buffer len ( ) ) , e => panic ! ( " " e ) , } } self . position = 0 ; } }
Handle sample buffering and sending them through the
asynchronous channel.
Handle sample buffering and sending them through the asynchronous channel .
&mut self
sample
Sample
&mut self
sample
Sample