RustAudio / dasp

The fundamentals for Digital Audio Signal Processing. Formerly `sample`.
Other
883 stars 64 forks source link

[Question] Is there a way to dynamically add a signal to mix? #157

Open TonalidadeHidrica opened 3 years ago

TonalidadeHidrica commented 3 years ago

I want to play a music and some sound effects. Can I dynamically add another Signal to mix while playing? As I see the Signal API, it seems to be designed for static mixing.

mitchmindtree commented 3 years ago

@TonalidadeHidrica that's right, using the Signal API it might be easier to reconstruct the full signal when you want to add or remove Signals dynamically. Alternatively, you could implement Signal for your own "signal collection" type that allows for adding/removing signals.

For dynamic composition of audio graphs, you might want to consider the dasp_graph crate - you can find a section in the docs discussing the difference to the dasp Signal API here.