Original Discord Post by heivoll | 2024-09-19 21:18:17
We are setting up a game UI in UE5 where we display the subtitles as speech is coming in - more like TV subtitles than a chatlog/chatbox. However, when using the On Text Received event, it seems that text comes in with a way too short audio duration, and then some durations come in without text later than that. However, there is a mix of incoming and durations that don’t seem correct. Is there a way to set up subtitles that show up as the character are saying them?
Example of incoming text events:
Text 1: Delay 1.755s
Text 2: Delay: 2.132s
Text 3: Delay: 1.42s
(No text) Delay: 1.5124s
(No text) Delay: 4.123s
(No text) Delay: 3.2122s
(No text) Delay: 4.321s
As far as I can tell there is no way of knowing which delay belongs to which text here.
Hello <@535882617170558986> , Currently, the way our backend works doesn’t guarantee precise timing for the OnTextReceived event. While you receive the text, the timing may not always match perfectly with the audio.
For your specific case, I recommend a workaround. You can use the GetTalkingTimeRemaining function in the Convai Chatbot to calculate the remaining speaking time and display the appropriate text based on the percentage of the speech completed. This should help synchronize the subtitles more effectively.