Communicator voice lines that are long have their subtitles disappear before the sound ends. Since short voice lines have their subtitles wait a while after they're done, I presume the subs have a fixed predefined timer length instead of checking the sound file length? Game version g4.2pre-257-g8ea46320c.
Video example:
In attachment there's a test map, it has one long voice file whose subtitles disappear too soon and a short one whose subtitles stay for a while. The latter's obviously not a problem, but it can be useful for checking both extremes.
Re: Subtitles for long voice lines end too soon.
Posted: Wed Jul 17, 2019 11:48 am
by Graf Zahl
The problem here is that sound and subtitles are handled independently of each other so without some deeper changes applying the length of the sound is not that simple.
Re: Subtitles for long voice lines end too soon.
Posted: Thu Jul 25, 2019 3:01 pm
by Xeotroid
Would it be possible to pass a length value to the subtitles manually? Here's all of the communicator sound files with their lengths:
I'm not sure where this should be stored or how to precisely use it, I just thought of this brute force solution if getting sound file lengths automatically is a pain in the ass. The subtitles are only used for Strife, anyway. If a value for a given sound exists, use it (and maybe add a second or two), and if it doesn't, use the default timer.
Re: Subtitles for long voice lines end too soon.
Posted: Thu Jul 25, 2019 3:04 pm
by Graf Zahl
Xeotroid wrote:The subtitles are only used for Strife, anyway.
No, the subtitles can be used for any mod that plays log sounds. It's implemented as a generic engine feature
Re: Subtitles for long voice lines end too soon.
Posted: Thu Jul 25, 2019 3:15 pm
by Xeotroid
Yeah, and I guess having to write a script to list their voice files' length isn't too appealing for a modder to do just because of subtitles. Still, it's better than nothing, right? No custom length = default length.
So far, so good, that's where I was already. There's just one minor issue here: S_GetMSLength calls the sound backend to retrieve the length, which has a few implications that need to be addressed.
1. Change the NullSoundRenderer's implementation to return a value more usable here - it's currently 250 for any sound.
2. On other backends this loads the sound into the backend and uses its query function to retrieve the length. For something as infrequently called as the log stuff this isn't a big issue but it may have to be addressed at some point in time.
Re: Subtitles for long voice lines end too soon.
Posted: Fri Jul 26, 2019 2:57 am
by Rachael
Slightly offtopic, but was S_GetMSLength exposed to ZScript at any point recently? Unless I am misremembering something. I have some pretty major concerns about allowing that, if the sound backend can give different values like that.
If that can be routed to its own function that processes the sound and gives a static value based on the sound itself and not the backend being used, then that would avert my concern.
Re: Subtitles for long voice lines end too soon.
Posted: Fri Jul 26, 2019 3:00 am
by _mental_
Graf Zahl wrote:1. Change the NullSoundRenderer's implementation to return a value more usable here - it's currently 250 for any sound.
I would rather turn synchronization off in this case. In other words, duration will be always set to 7 seconds.
Graf Zahl wrote:2. On other backends this loads the sound into the backend and uses its query function to retrieve the length. For something as infrequently called as the log stuff this isn't a big issue but it may have to be addressed at some point in time.
I assume that the requested sound will be played soon, or it’s already playing.
New variant of the scripted function can be added that takes duration in seconds instead of sound id.
Re: Subtitles for long voice lines end too soon.
Posted: Fri Jul 26, 2019 12:16 pm
by Graf Zahl
Added, but I changed it so that the subtitles always last at least 7 seconds.