Page 1 of 1

Typewriter sfx

Posted: Wed Dec 08, 2021 11:07 am
by iloveloon
Hi, I want to play an audio clip during typewriter effect.

I've already put my audio clip in sequence and it can play sound

but I can't figured out how to stop the audio clip when typewriter effect finish.

Re: Typewriter sfx

Posted: Wed Dec 08, 2021 11:51 am
by Tony Li
Hi,

Inspect your typewriter's Audio Source and make sure Loop is UNticked.

If your audio clip is very long and you don't want it to finish out when the last character has been typed, you can configure the typewriter's OnEnd() UnityEvent to call the Audio Source's AudioSource.Stop method.

Re: Typewriter sfx

Posted: Wed Dec 08, 2021 12:41 pm
by iloveloon
Hi, I don't know how to "configure the typewriter's OnEnd()" but I just find AudioStop() on documentation and successfully done what I want by using these sequence


Audio(NpcVoice1);
AudioStop()@Message(Typed);


Is this also the correct way to do it ? or I'll have a problem in the future ?

Re: Typewriter sfx

Posted: Wed Dec 08, 2021 1:07 pm
by Tony Li
That's fine if it does what you want. It will stop the audio playing on the speaking character.

If the typewriter's audio source isn't set to Loop, then it will stop when the last sound has finished on the last character. If you want to cut off the audio playing on the typewriter effect as soon as the last character is typed, you can configure OnEnd() like this:

stopTypewriterAudio.png
stopTypewriterAudio.png (84.96 KiB) Viewed 567 times

Re: Typewriter sfx

Posted: Wed Dec 08, 2021 1:52 pm
by iloveloon
Thank you !

I've found another problem, when my player response to my npc there are sounds from demo playing like
"Can't find the password" , "I'm still working on it" but I don't add those sound myself.
How can I remove them ? I use VN Template Standard Dialogue UI.

Re: Typewriter sfx

Posted: Wed Dec 08, 2021 4:49 pm
by Tony Li
Hi,

Remove or rename this folder:

Plugins / Pixel Crushers / Dialogue System / Demo / Resources

Then inspect your Dialogue Manager GameObject. Set Display Settings > Camera & Cutscene Settings > Default Sequence to:

Code: Select all

Delay({{end}})

Re: Typewriter sfx

Posted: Thu Dec 09, 2021 1:21 am
by iloveloon
Thank you !! it works perfectly

I'm gonna leave you a 5 stars review now.

Re: Typewriter sfx

Posted: Thu Dec 09, 2021 8:26 am
by Tony Li
Glad to help. Thank you very much for your review! :-D