Browse Source

fix text scroll speed (#1057)

pull/1082/head
qndel 5 years ago committed by GitHub
parent
commit
c45295463c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      SourceX/soundsample.cpp

4
SourceX/soundsample.cpp

@ -104,7 +104,9 @@ int SoundSample::GetLength()
bytePerSample = 1;
}
return chunk->alen * 1000 / (frequency * channels * bytePerSample);
Uint64 ms = 1000; // milliseconds, 64bit to avoid overflow when multiplied by alen
Uint32 bps = frequency * channels * bytePerSample; // bytes per second
return (Uint32)(chunk->alen * ms / bps);
};
} // namespace dvl

Loading…
Cancel
Save