Hi, I'm trying to use TypewriterEffect to play SFX alongside my text. My audio clip is pretty long (6s) but I'm using "Use Play One Shot" and "Interrupt Audio Clip" as I'm trying to play the SFX once for each character.
I'm experiencing an issue where the audio clip is played at roughly 2x the speed that the characters appear. This results in the audio finishing playback when only half the characters are on the screen. From my testing the typewriter effect itself seems to match the "Characters Per Second" value but the SFX is being played too fast.
Here's how my typewriter is configured:
I'm digging into the code to debug this, but just wanted to ask if you've seen this issue before? Maybe it's a configuration issue on my end?
TypewriterEffect plays SFX 2x faster than text
Re: TypewriterEffect plays SFX 2x faster than text
The code in and appear to be working as intended, calling PlayCharacterAudio() once as each character is displayed.
The issue seems to go away if I disable "Use Play One Shot", so problem solved. I suspect PlayOneShot() might be behaving strangely because of the high rate of calls.
Appreciate the work you do on this asset!
Code: Select all
AbstractTypewriterEffect
Code: Select all
UnityUITypewriterEffect
The issue seems to go away if I disable "Use Play One Shot", so problem solved. I suspect PlayOneShot() might be behaving strangely because of the high rate of calls.
Appreciate the work you do on this asset!
Re: TypewriterEffect plays SFX 2x faster than text
You're correct. Play One Shot doesn't work with Interrupt Audio Clip. When you play a one-shot, it spins off an entirely separate process for the audio clip that's no longer controlled by the typewriter, so the typewriter can't interrupt it.