sinshu / rustysynth

A SoundFont MIDI synthesizer written in pure Rust
Other
108 stars 20 forks source link

BaseAudioOutputDevice/run_output_device() persistence #17

Closed Tails closed 3 months ago

Tails commented 3 months ago

The examples mention running the run_output_device() function to play audio. It starts the render loop from JS by scheduling regular callbacks that call the Sequencer to generate the samples.

Should the dyn BaseAudioOutputDevice be persisted in the application, and run forever, or is it recommended to reopen/recreate the audio output device every time when one wants to play a sound?

sinshu commented 3 months ago

I have only used TinyAudio for the purpose of making RustySynth produce sound through the console, so I don't have a detailed understanding of how to use it 😖 I think it would be best to ask the author of TinyAudio.

Tails commented 3 months ago

Of course! Sorry I conflated the two. Thanks again for this port! I have used different JS SF2 synths over the years and yours is the best so far! Probably the maturing of the web audio API's also help, but still! Very grateful for what you did.