smol audio backend fix
This commit is contained in:
parent
f57103198f
commit
820a936cc4
@ -1,10 +1,12 @@
|
|||||||
sokol_audio_callback :: (buffer: *float, num_frames: s32, num_channels: s32) #c_call {
|
sokol_audio_callback :: (buffer: *float, num_frames: s32, num_channels: s32) #c_call {
|
||||||
push_context,defer_pop default_context;
|
push_context,defer_pop default_context;
|
||||||
|
|
||||||
if mono_track.count < 1 then return;
|
if mono_track.count < 1 then return;
|
||||||
|
|
||||||
for i : 0..num_frames-1 {
|
for i : 0..num_frames-1 {
|
||||||
buffer[i] = mono_track[cur_sample] * 0.1;
|
if cur_sample >= mono_track.count {
|
||||||
|
cur_sample = 0;
|
||||||
|
}
|
||||||
|
buffer[i] = mono_track[cur_sample] * 0.5;
|
||||||
cur_sample += 1;
|
cur_sample += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user