From 475a566e3588cec51492d3ca7741ba900e118e8f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 7 Sep 2015 21:17:26 -0700 Subject: Play a 1khz sine wave for 4 seconds in the loopback example --- examples/alloopback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/alloopback.c b/examples/alloopback.c index 2361ada1..04c92818 100644 --- a/examples/alloopback.c +++ b/examples/alloopback.c @@ -65,13 +65,13 @@ void SDLCALL RenderSDLSamples(void *userdata, Uint8 *stream, int len) * buffer ID. */ static ALuint CreateSineWave(void) { - ALshort data[44100]; + ALshort data[44100*4]; ALuint buffer; ALenum err; ALuint i; - for(i = 0;i < 44100;i++) - data[i] = (ALshort)(sin(i * 441.0 / 44100.0 * 2.0*M_PI)*32767.0); + for(i = 0;i < 44100*4;i++) + data[i] = (ALshort)(sin(i/44100.0 * 1000.0 * 2.0*M_PI) * 32767.0); /* Buffer the audio data into a new buffer object. */ buffer = 0; -- cgit v1.2.3