soundLength "classname" — duration in seconds of the CfgSounds entry's clip, resolved for the current voice language exactly as say/playSound do (FindSound applies the per-language " . . " suffix). Returns 0 for a subtitle-only entry or an unresolved key. Cutscene scripts can pace dialog to the real clip regardless of language, e.g. unit say "x00v05"; ~ (soundLength "x00v05") + 0.4
| 950 | // Cutscene scripts can pace dialog to the real clip regardless of language, e.g. |
| 951 | // unit say "x00v05"; ~ (soundLength "x00v05") + 0.4 |
| 952 | GameValue SoundLength(const GameState* state, GameValuePar oper1) |
| 953 | { |
| 954 | GameStringType name = oper1; |
| 955 | SoundPars pars; |
| 956 | pars.name = ""; |
| 957 | FindSound(name, pars); |
| 958 | if (pars.name.GetLength() <= 0 || !GSoundsys) |
| 959 | { |
| 960 | return 0.0f; |
| 961 | } |
| 962 | return GSoundsys->GetWaveDuration(pars.name); |
| 963 | } |
| 964 | |
| 965 | GameValue VoiceLanguage(const GameState* /*state*/) |
| 966 | { |
nothing calls this directly
no test coverage detected