From 090e47dca0618e2a188a1ac82be9940e8baa79ed Mon Sep 17 00:00:00 2001 From: TheManTheMythTheGameDev <76568234+TheManTheMythTheGameDev@users.noreply.github.com> Date: Tue, 2 Aug 2022 23:36:23 -0700 Subject: [PATCH] Fix rendering issue in audio_raw_stream.c example (#2608) --- examples/audio/audio_raw_stream.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c index cab69b1a1..afee42962 100644 --- a/examples/audio/audio_raw_stream.c +++ b/examples/audio/audio_raw_stream.c @@ -135,6 +135,11 @@ int main(void) { data[i] = (short)(sinf(((2*PI*(float)i/waveLength)))*32000); } + // Make sure the rest of the line is flat + for (int j = waveLength*2; j < MAX_SAMPLES; j++) + { + data[j] = (short)0; + } // Scale read cursor's position to minimize transition artifacts //readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));