Run as 'vois': install via make, config file, Auto-Tune, more presets, custom chains
- 'vois' installs to PATH (make install) and works with no flags: auto device selection (pipewire/pulse/default) and 48 kHz default - ~/.config/vois/config.toml for defaults + custom preset chains (serde) - Auto-Tune pitch correction (snap to nearest semitone, smoothed) - 5 new presets: Chipmunk, Helium, Vader, Telephone, Growl (17 total) - --pitch-correct flag, --no-virtual-mic to disable the default virtual mic - no dead-code allowances; clippy/fmt/tests clean
This commit is contained in:
parent
b0d685a110
commit
aacaf7d9cf
14 changed files with 753 additions and 285 deletions
|
|
@ -6,6 +6,8 @@ use cpal::{
|
|||
};
|
||||
use ringbuf::traits::Producer;
|
||||
|
||||
const PREFERRED_INPUTS: [&str; 3] = ["pipewire", "pulse", "default"];
|
||||
|
||||
pub fn find_input(host: &Host, name: Option<&str>) -> Result<Device> {
|
||||
match name {
|
||||
Some(name) => host
|
||||
|
|
@ -13,9 +15,20 @@ pub fn find_input(host: &Host, name: Option<&str>) -> Result<Device> {
|
|||
.context("failed to enumerate input devices")?
|
||||
.find(|d| d.name().map(|n| n == name).unwrap_or(false))
|
||||
.with_context(|| format!("input device {name:?} not found")),
|
||||
None => host
|
||||
.default_input_device()
|
||||
.context("no default input device found"),
|
||||
None => {
|
||||
let mut devices = host
|
||||
.input_devices()
|
||||
.context("failed to enumerate input devices")?;
|
||||
if let Some(device) = devices.find(|d| {
|
||||
d.name()
|
||||
.map(|n| PREFERRED_INPUTS.iter().any(|p| n == *p))
|
||||
.unwrap_or(false)
|
||||
}) {
|
||||
return Ok(device);
|
||||
}
|
||||
host.default_input_device()
|
||||
.context("no default input device found")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue