mirror of
https://github.com/RustAudio/rodio
synced 2024-12-13 13:42:34 +00:00
Decoder now produces i16s
This commit is contained in:
parent
e365488e06
commit
cbecbc8093
1 changed files with 5 additions and 6 deletions
|
@ -5,7 +5,6 @@ use std::fmt;
|
|||
use std::io::{Read, Seek};
|
||||
use std::time::Duration;
|
||||
|
||||
use Sample;
|
||||
use Source;
|
||||
|
||||
mod flac;
|
||||
|
@ -57,14 +56,14 @@ impl<R> Decoder<R>
|
|||
impl<R> Iterator for Decoder<R>
|
||||
where R: Read + Seek
|
||||
{
|
||||
type Item = f32;
|
||||
type Item = i16;
|
||||
|
||||
#[inline]
|
||||
fn next(&mut self) -> Option<f32> {
|
||||
fn next(&mut self) -> Option<i16> {
|
||||
match self.0 {
|
||||
DecoderImpl::Wav(ref mut source) => source.next().map(|s| s.to_f32()),
|
||||
DecoderImpl::Vorbis(ref mut source) => source.next().map(|s| s.to_f32()),
|
||||
DecoderImpl::Flac(ref mut source) => source.next().map(|s| s.to_f32()),
|
||||
DecoderImpl::Wav(ref mut source) => source.next(),
|
||||
DecoderImpl::Vorbis(ref mut source) => source.next(),
|
||||
DecoderImpl::Flac(ref mut source) => source.next(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue