You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In line 143 the samplenum for setting loop_end is calculated wrong. It assumes 4 bytes per sample, which isn't always correct and hence causes the loop to start earlier in some cases (e.g. 16 bit per sample / mono). As the bits_per_sample is calculated above it should be used to calculate the correct samplenum instead.
OLD: var samplenum = newstream.data.size() / 4 (line 143)
NEW: var samplenum = newstream.data.size() / (bits_per_sample / 8)
Note, that the bits_per_sample is initialized with 0. Hence this might result in a division by 0. Hence, I suggest something like assert(bits_per_sample != 0) as done above in the code... or do some other error handling. Thanks!
The text was updated successfully, but these errors were encountered:
In line 143 the
samplenum
for setting loop_end is calculated wrong. It assumes 4 bytes per sample, which isn't always correct and hence causes the loop to start earlier in some cases (e.g. 16 bit per sample / mono). As the bits_per_sample is calculated above it should be used to calculate the correctsamplenum
instead.OLD:
var samplenum = newstream.data.size() / 4
(line 143)NEW:
var samplenum = newstream.data.size() / (bits_per_sample / 8)
Note, that the bits_per_sample is initialized with 0. Hence this might result in a division by 0. Hence, I suggest something like assert(bits_per_sample != 0) as done above in the code... or do some other error handling. Thanks!
The text was updated successfully, but these errors were encountered: