use crate::dependencies::SOX;
use crate::transcode::CommandInfo;
use std::path::PathBuf;
pub struct Resample {
pub input: PathBuf,
pub output: PathBuf,
#[allow(clippy::struct_field_names)]
pub resample_rate: u32,
}
impl Resample {
#[must_use]
#[allow(clippy::wrong_self_convention)]
pub fn to_info(self) -> CommandInfo {
CommandInfo {
program: SOX.to_owned(),
args: vec![
self.input.to_string_lossy().to_string(),
"-G".to_owned(),
"-b".to_owned(),
"16".to_owned(),
self.output.to_string_lossy().to_string(),
"rate".to_owned(),
"-v".to_owned(),
"-L".to_owned(),
self.resample_rate.to_string(),
"dither".to_owned(),
],
}
}
}