mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-10 07:50:06 -04:00
Fix comment
This commit is contained in:
parent
f3511a1a71
commit
7121b78543
@ -30,13 +30,12 @@ using namespace SDL2pp;
|
|||||||
|
|
||||||
int main() try {
|
int main() try {
|
||||||
SDL sdl(SDL_INIT_AUDIO);
|
SDL sdl(SDL_INIT_AUDIO);
|
||||||
|
|
||||||
Mixer mixer(MIX_DEFAULT_FREQUENCY, AUDIO_S16SYS, 1, 4096);
|
Mixer mixer(MIX_DEFAULT_FREQUENCY, AUDIO_S16SYS, 1, 4096);
|
||||||
|
|
||||||
float frequency = 2093.00f; // C7 tone
|
float frequency = 2093.00f; // C7 tone
|
||||||
int64_t nsample = 0;
|
int64_t nsample = 0;
|
||||||
|
|
||||||
// Open audio device
|
// Set custom music hook which generates a sine wave
|
||||||
mixer.SetMusicHook([&nsample, frequency](Uint8* stream, int len) {
|
mixer.SetMusicHook([&nsample, frequency](Uint8* stream, int len) {
|
||||||
// fill provided buffer with sine wave
|
// fill provided buffer with sine wave
|
||||||
for (Uint8* ptr = stream; ptr < stream + len; ptr += 2)
|
for (Uint8* ptr = stream; ptr < stream + len; ptr += 2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user