Try starting monolith
Some checks failed
ci/woodpecker/push/code_tests Pipeline failed
ci/woodpecker/push/pre_commit_test Pipeline was successful

This commit is contained in:
Nikolai Rodionov
2025-12-18 16:03:54 +01:00
parent 213c5b1a47
commit 49e4f05b5e
3 changed files with 709 additions and 2 deletions

View File

@@ -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,
}