Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a smart way to play overlapping sounds? #161

Open
szymonnedzi opened this issue Apr 26, 2023 · 1 comment
Open

Is there a smart way to play overlapping sounds? #161

szymonnedzi opened this issue Apr 26, 2023 · 1 comment

Comments

@szymonnedzi
Copy link

szymonnedzi commented Apr 26, 2023

I'm developing an application that plays overlapping .wav files, and I want to be able to mute/unmute or pause/start a specific one on a specific input. Should I load the files into the same beep.Streamer and load it into one beep.Speaker or into the same beep.Buffer and then into a beep.Speaker or approach it in a different way? What's the 'correct' way to do so?

@MarkKremer
Copy link
Contributor

If you want to mute/pause specific sounds independently it's not useful to put them into the same beep.Buffer.

I would keep it simple by letting the speaker do the merging:

wav 1 -> buffer -> mute/pause
                        |
                        v
                     speaker
                        ^
                        |
wav 2 -> buffer -> mute/pause

The buffer alleviates the pressure on the speakers internal buffer a bit but I'm not certain it is required.

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

No branches or pull requests

2 participants