Fred Marshall wrote:
> "SA Dev" <[email protected]> wrote in message
> news:[email protected]..
>
>>Hi Bob,
>>
>>
>>>Must this be done in real time or is it possible to analyze
>>>the sound produced by each game as it is installed, for
>>>example? If the latter, you can do the root mean square
>>>calculation to determine an average level for each such
>>>game, save it somewhere, and apply a fixed gain (numerical
>>>multiplication factor) to each sample at play time that is a
>>>the ratio of the desired average level to the predetermined
>>>level of the game.
>>
>>Yes, someone elses approach was similar to this (they didn't use RMS, but
>>rather just rather just peaks to determine if the volume was too loud).
>>They started out at 10 times normal volume and reduced the volume if
>>necessary to make it fit within the 16 bit integer. Then they stored the
>>multiplication factor so the game would start out next at the already
>>reduced factor. So, one time the game was run, sounds at first might be
>>louder than they should be until the loudest sounds of the game were
>>encountered, but then they would be leveled out. The problem is that
>
> their
>
>>idea of looking at the peaks only resulted in wide variations between
>
> games.
>
>>I think that is the part of their logic that is flawed.
>>
>>I agree with the store multiplication factor, but the technique for using
>>the peaks to determine volume doesn't work well. That is what I'm trying
>
> to
>
>>improve.
>
>
> "using the peaks doesn't work well" in what way?
>
> You might consider averaging (lowpass filtering) the peaks so the highest
> one or two don't drive the result - IF that's your concern.
>
> Fred
Whatever the criterion, if there's a chance that the gain product might
exceed the integer range, then you have to saturate rather than wrap
around, and to do it right, you ought to low-pass filter to smooth the
hard corners due to clipping. (But you'll get by if you don't.)
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ