Re: [linux-audio-dev] sophomore questions

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] sophomore questions
From: ljp (ljp_AT_llornkcor.com)
Date: Wed Apr 04 2001 - 04:53:14 EEST


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


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat Apr 07 2001 - 15:59:34 EEST