Skip to content

Playing a lot of short sounds in short periods of time #58

@trueneu

Description

@trueneu

This is not an issue actually, but more of a question.
I'm trying to develop a metronome app. Thus I need it to play a lot of short sounds (metronome division/beat clicks) with a short delay between them (say, in a tempo of 250 bpm, the delay between the closest division clicks should be 60 ms, not counting the length of click sound itself).
Here's the problem I'm having: if I open the stream and just write to it, I'm getting "Output underflowed" between each pair of clicks, which is understandable as they're just a few milliseconds long. If I close/reopen the stream after/before each write, I'm facing a performance impact, and the playback gets all glitchy. The only workaround I came with so far is to add just a perfect amount of silence to each click sound sample, but I don't like it as it's really a hack, as the needed amount depends on tempo and sample length, and I'm not sure it'll work perfectly. My understanding of how underlying things work is too thin to come up with something beautiful, unfortunately.
Is there a chance you could recommend something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions