Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulgrell/2d7c51132ac69a76fda961623c2cd0f2 to your computer and use it in GitHub Desktop.
Save raulgrell/2d7c51132ac69a76fda961623c2cd0f2 to your computer and use it in GitHub Desktop.
const AUDIO_BUFFER_SIZE = 2048;
const a: f32 = 0.1;
var beep = blk: {
var b = []f32 { 0 } ** AUDIO_BUFFER_SIZE;
@setEvalBranchQuota(AUDIO_BUFFER_SIZE * 2 + 1);
for (b) |*x, i| {
x.* = if ((i / 64) % 2 == 1) a else -a;
}
break :blk b;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment