GetTransmissionDuration

Parameters
soundHandle sound
timeType integer
timeVal real
comment
patch

1.00

Source
Blizzard.j
return type
real
Source code
function GetTransmissionDuration takes sound soundHandle, integer timeType, real timeVal returns real
local real duration

if (timeType == bj_TIMETYPE_ADD) then
set duration = GetSoundDurationBJ(soundHandle) + timeVal
elseif (timeType == bj_TIMETYPE_SET) then
set duration = timeVal
elseif (timeType == bj_TIMETYPE_SUB) then
set duration = GetSoundDurationBJ(soundHandle) - timeVal
else
// Unrecognized timeType - ignore timeVal.
set duration = GetSoundDurationBJ(soundHandle)
endif

// Make sure we have a non-negative duration.
if (duration < 0) then
set duration = 0
endif
return duration
endfunction