We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fc8e6d commit f989a1bCopy full SHA for f989a1b
source/openfl/media/Sound.hx
@@ -695,7 +695,8 @@ class Sound extends EventDispatcher
695
// var samples = (__buffer.data.length * 8) / (__buffer.channels * __buffer.bitsPerSample);
696
// return Std.int(samples / __buffer.sampleRate * 1000);
697
var samples = (Int64.make(0, __buffer.data.length) * Int64.ofInt(8)) / Int64.ofInt(__buffer.channels * __buffer.bitsPerSample);
698
- var value = samples / Int64.ofInt(__buffer.sampleRate) * Int64.ofInt(1000);
+ var div = Int64.divMod(samples * Int64.ofInt(1000), Int64.ofInt(__buffer.sampleRate));
699
+ var value = (div.quotient + (div.modulus / __buffer.sampleRate));
700
return Int64.toInt(value);
701
}
702
else if (__buffer.__srcVorbisFile != null)
0 commit comments