double -> float

This commit is contained in:
Sébastien Bourdeauducq 2024-12-27 15:10:15 +08:00
parent 75f0393c7c
commit 4551324940

View File

@ -72,7 +72,7 @@ static void dsp_thread()
if(buf_out_idx == SND_BUFLEN*SND_PCHAN) { if(buf_out_idx == SND_BUFLEN*SND_PCHAN) {
uint32_t ftw = frequency*(float)UINT32_MAX/SND_RATE; uint32_t ftw = frequency*(float)UINT32_MAX/SND_RATE;
for(int i=0;i<SND_BUFLEN;i++) { for(int i=0;i<SND_BUFLEN;i++) {
buf_out[2*i] = buf_out[2*i+1] = (INT16_MAX-1)*sin(phase*2.0f*(float)M_PI/(float)UINT32_MAX); buf_out[2*i] = buf_out[2*i+1] = (INT16_MAX-1)*sinf(phase*2.0f*(float)M_PI/(float)UINT32_MAX);
phase += ftw; phase += ftw;
} }
buf_out_idx = 0; buf_out_idx = 0;