Given the FrameRate() function returns quite limited
precision, less then 32 bit float, can functions for
FrameRateNumerator() and FrameRateDenominator() be
include in the scripting interface.
Attached are updated script.cpp and script.h files
that implement these 2 extra functions. In addition
in order to maximise the restricted precision the code
for FrameRate() has been modified to perform the
division of numerator by denominator using double
precision which finally in turn is reduced to a float.
Also included is an alternate version of
AudioLength(), called AudioLengthF(), which returns a
float. Although of limited precicion, it does not
become negative when more than 2^31 samples are
present and gives the correct order of magnitude.
(Devious scripting using both functions and modulo
arithmetic can represent the exact audio sample count
Log in to post a comment.