Rust fmt
This commit is contained in:
2 files changed
+13
-3
No files matched your search
+6
-1
@@ -22,7 +22,12 @@ pub struct Opt {
|
||||
#[structopt(short, long, conflicts_with = "file_path")]
|
||||
pub microphone: bool,
|
||||
/// Use a specific microphone like "alsasrc device=hw:1"
|
||||
#[structopt(short, long, default_value = "autoaudiosrc", conflicts_with = "file_path",)]
|
||||
#[structopt(
|
||||
short,
|
||||
long,
|
||||
default_value = "autoaudiosrc",
|
||||
conflicts_with = "file_path"
|
||||
)]
|
||||
pub input_src: String,
|
||||
/// Use to change the volume of the input
|
||||
#[structopt(short, long, default_value = "1.0")]
|
||||
|
||||
+7
-2
@@ -80,12 +80,17 @@ pub fn main(opt: Opt) -> Result<(), Error> {
|
||||
|
||||
let rx = match (&opt.file_path, &opt.microphone) {
|
||||
(Some(path), false) => gst::from_input(
|
||||
&format!("filesrc location={}", path.to_str().expect("File path not UTF8 complient")),
|
||||
&format!(
|
||||
"filesrc location={}",
|
||||
path.to_str().expect("File path not UTF8 complient")
|
||||
),
|
||||
opt.volume,
|
||||
block_size,
|
||||
sample_rate,
|
||||
)?,
|
||||
(None, true) => gst::from_input(&opt.input_src, opt.volume, block_size, sample_rate)?,
|
||||
(None, true) => {
|
||||
gst::from_input(&opt.input_src, opt.volume, block_size, sample_rate)?
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user