summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTheManTheMythTheGameDev <[email protected]>2022-08-02 23:36:23 -0700
committerGitHub <[email protected]>2022-08-03 08:36:23 +0200
commit090e47dca0618e2a188a1ac82be9940e8baa79ed (patch)
treed04f8e16eb74a6760a8f75131a67c706a762f29f
parent1a35f73d84eaad45964115cba759d84a6286df54 (diff)
downloadraylib-090e47dca0618e2a188a1ac82be9940e8baa79ed.tar.gz
raylib-090e47dca0618e2a188a1ac82be9940e8baa79ed.zip
Fix rendering issue in audio_raw_stream.c example (#2608)
-rw-r--r--examples/audio/audio_raw_stream.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c
index cab69b1a..afee4296 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));