Code: Select all
double y, t=0;
short audio16;
FILE *outFile;
// insert useful code here
for(i=0;i<100;i++){
y=sin(t);
t+=0.1;
audio16 = floor(y*32767.0+0.5);
fwrite(&audio16,2,1,outFile);
}
What do I do if I want to write 8, 24, 32-bit audio? If I have a variable, say audio24, that is 24-bit, what data type do I use to represent it? This is not as important, but how in the world do I write 20-bit audio?

