View Single Post
  #14 (permalink)  
Old 02-25-2004, 11:14 PM
Jim Thomas
Guest
 
Posts: n/a
Default Re: Is there a quick, not much processing time needed, way to makethe same volume on a 16 signed int stream in real time?

SA Dev wrote:
> BTW, I'm having a real hard time getting why the RMS power can be equated to
> the volume you hear. If you had a wav file that had only one sample in it,
> say 10000, you wouldn't hear anything because there is no difference to make
> the sound, yet the power it used was significant...


I assume you mean "that had all the samples equal to 10000" rather than
"that had only one sample in it, say 10000."

Because you can't hear DC no matter how much power it contains. Here's
what I would do if I were you.

1) calculate the average value (i.e., the DC component).
2) Subtract it out of the samples.
3) compute the RMS.
4) calculate scale (inversely proportionate to RMS)
5) multiply each sample by scale.

You can do all of these steps offline and store the resulting wav file.
But if you do that, you can manually adjust the volume (use cooledit or
something like that) until your ear likes it, and store the adjusted
wav. There is really no reason to adjust the wav file on the fly.

--
Jim Thomas Principal Applications Engineer Bittware, Inc
[email protected] http://www.bittware.com (703) 779-7770
To understand recursion, one must first understand recursion.

Reply With Quote