I’m currently working on a project aimed at children who cannot read.
All menus and buttons are narrated to aid their understanding of the game.
The Problem : Currently, the player can sporadically move the mouse over various buttons and be greeted with a cacophony of overlapping voice sounds being played.
The way this is set up:
All buttons have their narration
sounds played using the “On Hover”
setting in UMG.
Some menus also have a sound play on
construct, to explain the meaning of
the particular screen.
This is a 100% blueprint based project.
I have my sound classes and mix set up, and all of the sound files are set to have a maximum of 1 concurrent play, meaning the sound cannot be repeated unless the first has finished.
However, this only applies to individual sounds overlapping themselves. Is there any way of applying this logic to an entire sound class? Meaning that only one sound in the narration class can be played at any time?
You need to playout sound from single audio component, it works like player and single audio component won’t play 2 sound cues in same time. You will need to stop sound, switch sound and play it
Sadly, I have absolutely no idea on how to code - especially with C++.
I’m using 100% blueprints here. I understand the logic of the code you posted, but have no idea on how to achieve this with BP (if it is possible at all)
Isn’t it somehow possible to use a simple bool for that? I don’t know if this would really work, but is it possible to get the remaining time of a sound?
You could do this for every sound (a function that gets the sounds as a paramter would be helpfull then). Just chech if the bool (e.g.) “bIsPlaying” is false and only then play your sound. If you play your sound, set the bool to true and get the remaining time of the sound. If the remaining time is less than 0.1 or something like that, set the bool back to false.
I’m totally sorry if this doesn’t work, since i haven’t worked with sounds yet and i have no time digging into my Editor right now. Maybe this still helps you.