fix buf_out index

This commit is contained in:
Sébastien Bourdeauducq 2024-12-28 19:04:48 +08:00
parent 7b4d0677a1
commit 36a2405f83

View File

@ -87,7 +87,7 @@ static void dsp_thread()
if(buf_out_offset == sizeof(buf_out)) {
for(int i=0;i<SND_PCHAN;i++)
for(int j=0;j<SND_BUFLEN;j++) {
buf_out[2*j+i] = scale*sin(phase_out[i]*2.0*M_PI/(double)UINT32_MAX);
buf_out[SND_PCHAN*j+i] = scale*sin(phase_out[i]*2.0*M_PI/(double)UINT32_MAX);
phase_out[i] += ftw[i]; // wraps on overflow
}
buf_out_offset = 0;