Typewriter sfx

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
iloveloon
Posts: 10
Joined: Wed Dec 01, 2021 12:49 pm

Typewriter sfx

Post 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.
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Typewriter sfx

Post 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.
iloveloon
Posts: 10
Joined: Wed Dec 01, 2021 12:49 pm

Re: Typewriter sfx

Post 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 ?
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Typewriter sfx

Post 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 561 times
iloveloon
Posts: 10
Joined: Wed Dec 01, 2021 12:49 pm

Re: Typewriter sfx

Post 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.
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Typewriter sfx

Post 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}})
iloveloon
Posts: 10
Joined: Wed Dec 01, 2021 12:49 pm

Re: Typewriter sfx

Post by iloveloon »

Thank you !! it works perfectly

I'm gonna leave you a 5 stars review now.
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Typewriter sfx

Post by Tony Li »

Glad to help. Thank you very much for your review! :-D
Post Reply