АК
Size: a a a
АК
d
АК
АК
АК
U
АК
d
АК
АК
d
float generateSample(int iSecond, float fSecond) {
auto freq = 262.63f;//
auto t = iSecond * fract(freq);
return std::sin((fSecond * freq + t) * 2 * PI)/* * std::exp(-3.0 * fSecond)*/;
}
АК
float generateSample(int iSecond, float fSecond) {
auto freq = 262.63f;//
auto t = iSecond * fract(freq);
return std::sin((fSecond * freq + t) * 2 * PI)/* * std::exp(-3.0 * fSecond)*/;
}
АК
АК
// Test function for generating float sin (300 to 600 Hz)
static bool state = false;
static fr_f32 phase = 0.f;
static fr_f32 freq = 150.f;
fr_f32* pBuf = (fr_f32*)pByte;
for (size_t i = 0; i < AvailableFrames * CurrentChannels; i++) {
if (freq >= 600.f / CurrentChannels) state = !state;
pBuf[i] = sinf(phase * 6.283185307179586476925286766559005f) * 0.1f;
phase = fmodf(phase + freq / SampleRate, 1.0f);
freq = !state ? freq + 0.001f : freq - 0.001f;
if (freq <= 300.f / CurrentChannels) state = !state;
}
d
S
S
ダコ
d
// Test function for generating float sin (300 to 600 Hz)
static bool state = false;
static fr_f32 phase = 0.f;
static fr_f32 freq = 150.f;
fr_f32* pBuf = (fr_f32*)pByte;
for (size_t i = 0; i < AvailableFrames * CurrentChannels; i++) {
if (freq >= 600.f / CurrentChannels) state = !state;
pBuf[i] = sinf(phase * 6.283185307179586476925286766559005f) * 0.1f;
phase = fmodf(phase + freq / SampleRate, 1.0f);
freq = !state ? freq + 0.001f : freq - 0.001f;
if (freq <= 300.f / CurrentChannels) state = !state;
}
АК