softare/resampling: add extension helpers for frame::Audio

This commit is contained in:
meh
2015-09-29 00:13:40 +02:00
parent 33a116023e
commit c79e8751a9

View File

@ -1,7 +1,14 @@
use util::format;
use ::{decoder, Error, ChannelLayout};
use ::{decoder, Error, ChannelLayout, frame};
use super::Context;
impl frame::Audio {
pub fn resampler(&self, format: format::Sample, channel_layout: ChannelLayout, rate: u32) -> Result<Context, Error> {
Context::get(self.format(), self.channel_layout(), self.rate(),
format, channel_layout, rate)
}
}
impl decoder::Audio {
pub fn resampler(&self, format: format::Sample, channel_layout: ChannelLayout, rate: u32) -> Result<Context, Error> {
Context::get(self.format(), self.channel_layout(), self.rate(),