Skip to content

SoundEffect with frequencies above 10 KHz don't make a sound #120

Closed
@microbit-carlos

Description

@microbit-carlos

I'm guessing the frequency string format only takes 4 digits?

This works:

audio.play(audio.SoundEffect(
    freq_start=9999,
    freq_end=9999,
    duration=300,
    vol_start=255,
    vol_end=255,
))

But this doesn't make a sound:

audio.play(audio.SoundEffect(
    freq_start=10000,
    freq_end=10000,
    duration=300,
    vol_start=255,
    vol_end=255,
))

I think 10000 is likely converted to 0. As a SoundEfect like this sounds like it's going from high frequency to low frequency.

audio.play(audio.SoundEffect(
    freq_start=9999,
    freq_end=10000,
    duration=500,
    vol_start=255,
    vol_end=255,
))

Should we throw an exception or clamp for values >10K?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions