浏览代码

Fix rendering issue in audio_raw_stream.c example (#2608)

pull/2611/head
TheManTheMythTheGameDev 2 年前
committed by GitHub
父节点
当前提交
090e47dca0
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. +5
    -0
      examples/audio/audio_raw_stream.c

+ 5
- 0
examples/audio/audio_raw_stream.c 查看文件

@ -135,6 +135,11 @@ int main(void)
{ {
data[i] = (short)(sinf(((2*PI*(float)i/waveLength)))*32000); 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 // Scale read cursor's position to minimize transition artifacts
//readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength)); //readCursor = (int)(readCursor * ((float)waveLength / (float)oldWavelength));

||||||
x
 
000:0
正在加载...
取消
保存