如何转换SInt16为double或?我知道我可以转换成这样:Float32doubleSInt16Float32
double *buffer;
SInt16* frames;
for (i = 0; i < number_of_frames; i++) {
Float32 currentFrame = frames[i] / 32768.0f;
}
但我正在使用许多 C 函数,我想将数据传递给它们double。
现在我使用这段代码:
for (i = 0; i < number_of_frames; i++) {
Float32 currentFrame = frames[i] / 32768.0f;
buffer[i] = currentFrame;
}
但我不确定结果是否正确。