[MPlayer-users] Volume Control Suggestion

Attila Kinali kinali at gmx.net
Mon Dec 31 20:51:44 CET 2001


On Mon, 31 Dec 2001 06:09:25 -0500 (EST)
Hui Zhang <huiz at gradient.cis.upenn.edu> wrote:

> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> I tried to hack it by multiplying or deviding 2 off the numbers stored in
> the buffer retrieved from decode_audio.  It seems to have the effect
> of doubling the volume with multiplying, but the effect of deviding leaves
> me with just added noises.  I guess it is not trivial to do.  Any opinion
> >from expert?  But I do think it is a legit and useful feature to have, if
> multiple sound generating programs can share the sound in a civil way.
> I know windows media player does that.

Yes, it is that simple, as Stephen mentioned, it's just a matter of
multiplication (with any value between 0 and infinity), but
you'll lose bit resolution with values < 1 or have to check for
overflows as most movies come with normalized sound (this means
that the full number range is used). Where the mixer settings
(ie the volume settings) adjust an amplifier on the soundcard.
If you want to hear how quantisation noise (how this effect is called)
sounds, try a sample &= 0xf0; 

I'm not telling that it's useless what you want to do, but that
the right way is to set the mixers and maybe restore them after
mplayer quits as this garants best sound quality.


		Attila Kinali

-- 
I am a moslem, i am a terrorist.




More information about the MPlayer-users mailing list