This commit is contained in:
QuantumEntangledAndy committed 2021-08-07 16:05:58 +07:00
1 parent a83ec69663
commit 561f893d2a
2 files changed
+13 -3

No files matched your search

+6 -1
View File
@@ -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
View File
@@ -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!(),
};