Try starting monolith
This commit is contained in:
41
src/main.rs
41
src/main.rs
@@ -1,3 +1,40 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::{fs::File, path::PathBuf};
|
||||
|
||||
use alsa::{Direction, PCM, ValueOr, device_name::Hint, pcm::{Access, Format, HwParams}};
|
||||
use clap::{Parser, Subcommand, ValueEnum};
|
||||
use symphonia::{core::{audio::{AudioBufferRef, Signal}, codecs::DecoderOptions, formats::FormatOptions, io::MediaSourceStream}, default::{get_codecs, get_probe}};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
enum Backend {
|
||||
Jack,
|
||||
Alsa,
|
||||
Pulseaudio,
|
||||
}
|
||||
#[derive(Parser)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Cli {
|
||||
name: Option<String>,
|
||||
#[arg(short, long, value_enum)]
|
||||
backend: Option<Backend>,
|
||||
#[arg(short, long)]
|
||||
path: String,
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
// You can check the value provided by positional arguments, or option arguments
|
||||
if let Some(backend) = cli.backend {
|
||||
match backend {
|
||||
Backend::Jack => println!("jack"),
|
||||
Backend::Alsa => println!("alsa"),
|
||||
Backend::Pulseaudio => println!("pulse"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DecodedAudio {
|
||||
pub samples: Vec<i16>, // interleaved
|
||||
pub sample_rate: u32,
|
||||
pub channels: u16,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user