To put it as simply as I can.
- I receive data from device and the signal is 24 bit signed int.
- I want to create 16 bit WAV file.
- For this purpose I want to keep writing upcoming audio buffer with 256 samples to *.wav file stream.
- How can I convert buffer values (well values written in simple pointer to 256 element array) from [24 bit signed int] to [16 bit signed int].
Is there any scaling value? For example when I wanted to cast [24 bit signed int] to [24 bit signed double] I did it like this:
for (int i=0; i<256; i++) {
bufferInDouble = *((int*)bufferRawData[currentPan]+i) / (double)0x7fffffff;
}
Any similar method could be there?
Aucun commentaire:
Enregistrer un commentaire