My audio application has a mixer for mixing multiple audio sources.  I need to 
prevent the mixed volume to be larger than the allowed values which are -32768 
to 32767.  I'm currently doing the following 2 tests but I'm thinking there 
must be a more efficient way of doing this in 1 test.

     if NewVol > 32767 then NewVol := 32767;
     if NewVol < -32768 then NewVol := -32768;

Being an audio app, it's handling lots of data continuously so the more 
efficiency the better.  Any suggestions?

Thanks,
Ross.
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to