Skip to content

Conversation

@YichiZhang0613
Copy link
Contributor

In rodio/src/source/signal_generator.rs, frequency should be > 0 according to semantic but code allows it to be negative, so assertion should be changed into assert!(frequency > 0.0, "frequency must be greater than zero");

pub fn with_function(
    sample_rate: SampleRate,
    frequency: f32,
    generator_function: GeneratorFunction,
) -> Self {
    assert!(frequency != 0.0, "frequency must be greater than zero");
    let period = sample_rate as f32 / frequency;

@yara-blue yara-blue merged commit 1b3459a into RustAudio:master Nov 6, 2025
9 checks passed
@yara-blue
Copy link
Member

thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants