[Solved] Sound problem with dialogue system

Hello, I am using a short sound that is looping when a dialogue with yarn is scrolling. And the problem that I have is that when the text is finished scrolling, the sound on a channel is sometimes stopped at the middle of the short sound, which cause a small glitch in the audio. And I am wondering if there is a condition that makes the sound of the channel stopped only if the short sound is finished playing? I’ve tried using conditions like stopping a sound on a channel or a sound isn’t playing, but it doens’t work, probably because it is looping?

Please share some of the events as screenshot if is possible so we can investigate better

Thanks, I added a screenshot on my post.

Try this for stater change loop:yes to loop:no in the sound, plus add a volume value to the sound between (0, 100), I normally use a variable to store the music_vol and sfx_vol looks line sfx_vol = 94 so later assign that variable to each sound i play in game.

Play the sound “Bla.waw” on the channel 2, vol:Variable(sfx_vol), loop:no

If your intent is for the sound to be played when every word is displayed, you need to move the play sound to be inside the timer and check if the text completed is false, you can do that inverting the condition.


Edit: the Variable(g_text_scroll_speed) = 0.02

So, I tried this, but the sound is being played every letter instead of every word, which is too fast for me.

Play with the values of TextScrollSpeed a higher value means more time to display the text and play the sound. if that is doesn’t fit for you leave the TextScrollSpeed at 0.07 but just add another timer only specific for the sound.
Begin of the scene
Reset timer “DialogueSound”
Pause timer
When the dialogue is started unpause “DialogueSound”
if timer “DialogueSound” is greater than 0.5
Play the sound.

Thanks! Now I can change the speed of the sound. The only problem now is that the sound isn’t fully playing, only a fraction of the sound is playing.

Fixed it! I only needed to change the " play the sound of a channel" by “play a sound” not on a channel. Thank you very much for all the help.

1 Like