dialogic icon indicating copy to clipboard operation
dialogic copied to clipboard

Improve sound event to allow for long sounds

Open Jowan-Spooner opened this issue 1 year ago • 1 comments

The sound event is currently designed with short sounds in mind and this especially means:

  • There is no way of stopping sounds, not even stopping all sounds (stopping individual sounds would imply we can identify them somehow)
  • Sounds are not saved. If you have a long sound then it will NOT play after loading a save from a moment where the sound was still playing.

Jowan-Spooner avatar Feb 09 '24 18:02 Jowan-Spooner

Perhaps a good solution would be to implement a string "reference name" field to the sound event, if set, the sound is stored in a Dictionary using that as the key (and if one with the same key already exists, replace it in the Dictionary and stop the old one to prevent conflicts, though might be good to warn users of duplicate keys in a Timeline).

When the sound finishes on its own it could remove itself from the Dictionary.

This way a StopSound [key] node could be used to stop playing an existing played sound. And the Dictionary could be stored in the save and processed on load to start playing any existing sounds in it.


Or alternatively, just use the sound file path as the key, avoiding any typing mistakes. User could click a checkbox for "Track playing sound", and then have a Stop Sound node that also has an audio file path input and stop stop any audio playing that file path.

Invertex avatar May 05 '24 00:05 Invertex