deprimus / Tale

Prop manipulation utility designed for storytelling. Tale is the core of all our projects.
MIT License
3 stars 0 forks source link

Add looping support for the Sound action #8

Open UnexomWid opened 2 years ago

UnexomWid commented 2 years ago

An extra parameter should be added to the sound action, such that a specific sound can be looped on a channel. Something like this:

Tale.Parallel(
    Tale.Sound.Play("sound", true)
);

// some time later

Tale.Sound.Stop();
UnexomWid commented 2 years ago

After thinking about it for a while, I guess this works just fine:

Tale.Parallel(
    Tale.Repeat(0, Tale.Sound.Play("sound"), true)
);

Therefore, I don't think we need a looping option for the sound actions.

@AndrewIGD what are your thoughts?

EDIT: if, for example, a sound channel is used for environmental sound effects which must loop seamlessly, then I can see a use for the loop option. Therefore, this should still be implemented in the future.

AndrewIGD commented 2 years ago

While this would work, perhaps even for environmental sound effects, I'd much rather have a loop option for the Play method, it would be much more easier for a beginner and cleaner overall.