浏览代码

Fix crash with delay demo. (#2472)

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

+ 4
- 3
examples/audio/audio_music_stream.c 查看文件

@ -68,15 +68,16 @@ int main(void)
Music music = LoadMusicStream("resources/country.mp3");
// Allocate buffer for the delay effect
delayBuffer = (float *)RL_CALLOC(48000*2, sizeof(float)); // 1 second delay (device sampleRate*channels)
delayBufferSize = 48000 * 2;
delayBuffer = (float *)RL_CALLOC(delayBufferSize, sizeof(float)); // 1 second delay (device sampleRate*channels)
PlayMusicStream(music);
float timePlayed = 0.0f;
bool pause = false;
bool hasFilter = false;
bool hasDelay = false;
bool hasFilter = true;
bool hasDelay = true;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------

正在加载...
取消
保存