At 15:21 4/3/2001 -0700, Simon Per Soren Kagedal wrote:

>Basically, yes, minus some bugs (overflowing the inbuffer...).
>
>short inbuffer[BUFSIZE], leftBuf[BUFSIZE/2];    /* or whatever type
>                                                    you have */
>read (sd, inbuffer, BUFSIZE);
>for (i=0; i<BUFSIZE/2; i++)
>         leftBuf[i] = inbuffer[2*i] * gain;
>write (file_d, leftBuf, BUFSIZE/2);

doh, I didn't even think about it.



>I don't really see what you mean but sure, of course you could as well
>in the above example change BUFSIZE to BUFSIZE*2 and BUFSIZE/2 to
>BUFSIZE...  Doesn't really matter.  :)

I just didn't know why the code writer did it this way. I thought it might 
be some kinda  weird rounding deal.
:)


thanks-
ljp


Reply via email to