mirror of https://github.com/odrling/Aegisub
Make dummy audio provider generate non-periodic noise
This commit is contained in:
parent
bfe7e4688a
commit
ca555359d9
|
@ -50,7 +50,7 @@ class DummyAudioProvider final : public AudioProvider {
|
||||||
|
|
||||||
void FillBuffer(void *buf, int64_t start, int64_t count) const override {
|
void FillBuffer(void *buf, int64_t start, int64_t count) const override {
|
||||||
if (noise) {
|
if (noise) {
|
||||||
std::default_random_engine e;
|
std::default_random_engine e(int32_t(start >> 32) ^ int32_t(start));
|
||||||
std::uniform_int_distribution<int16_t> uniform_dist(-5000, 5000);
|
std::uniform_int_distribution<int16_t> uniform_dist(-5000, 5000);
|
||||||
for (int64_t i = 0; i < count; ++i)
|
for (int64_t i = 0; i < count; ++i)
|
||||||
static_cast<short *>(buf)[i] = uniform_dist(e);
|
static_cast<short *>(buf)[i] = uniform_dist(e);
|
||||||
|
|
Loading…
Reference in New Issue