Merge pull request #51 from tomaka/fix-signed

Fix signed/unsigned formats mismatch
This commit is contained in:
tomaka 2015-07-22 15:18:56 +02:00
commit 7c76613aba
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ fn main() {
};
if let Some(output) = buffer.next() {
*output = next_sample as u16;
*output = next_sample;
data = &data[1..];
} else {
break;

View File

@ -50,7 +50,7 @@ impl Voice {
}
pub fn get_samples_format(&self) -> ::SampleFormat {
::SampleFormat::U16
::SampleFormat::I16
}
pub fn append_data<'a, T>(&'a mut self, max_elements: usize) -> Buffer<'a, T> where T: Clone {

View File

@ -40,7 +40,7 @@ impl Voice {
pub fn get_samples_format(&self) -> ::SampleFormat {
match self.bits_per_sample {
16 => ::SampleFormat::U16,
16 => ::SampleFormat::I16,
_ => unimplemented!(),
}
}