channel sample rate confirmed page size
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -16,8 +16,8 @@ fn main() {
|
|||||||
// Setup the audio output.
|
// Setup the audio output.
|
||||||
let params = OutputDeviceParameters {
|
let params = OutputDeviceParameters {
|
||||||
channels_count: 2,
|
channels_count: 2,
|
||||||
sample_rate: 44100,
|
sample_rate: flags.sample_rate,
|
||||||
channel_sample_count: 4410,
|
channel_sample_count: flags.sample_rate / flags.smallest_note,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create the synthesizer.
|
// Create the synthesizer.
|
||||||
@@ -55,8 +55,14 @@ fn main() {
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
#[derive(Parser, Debug, Clone)]
|
#[derive(Parser, Debug, Clone)]
|
||||||
struct Flags {
|
struct Flags {
|
||||||
#[arg(short, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
|
||||||
|
#[arg(long, default_value_t = 4)]
|
||||||
|
smallest_note: usize,
|
||||||
|
|
||||||
|
#[arg(long, default_value_t = 44100)]
|
||||||
|
sample_rate: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user