Limiter to avoid distorsion.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Limiter to avoid distorsion.

fredvs
Administrator
Hello.

Some audio files are encoded with over-value (level > 1).
That cause distortion and bad noise.

You may filter this with: uos_AddDSPVolumeIn() and,
if you do not want to change volume but only apply filter,
set volume to 1. (of course if volume < 1, it is filtered too).

Example:

 uos_CreatePlayer(PlayerIndex1);
 InIndex1 := uos_AddFromFile(PlayerIndex1,(pchar(SoundFilename)));
 
 uos_AddDSPVolumeIn(PlayerIndex1, InIndex1, 1, 1);  // this added
 
Fre;D
   
Reply | Threaded
Open this post in threaded view
|

Re: Limiter to avoid distorsion.

fauri
I'd realized that. But, for me, changing the sample format in uos_AddIntoDevOut did the trick.

change
uos_AddIntoDevOut(0, -1, -1, -1, -1, -1, -1) // Int16 by default
to
uos_AddIntoDevOut(0, -1, -1, -1, -1, 0, -1); // Float32
Reply | Threaded
Open this post in threaded view
|

Re: Limiter to avoid distorsion.

fredvs
Administrator
This post was updated on .
Ha, ok, nice that you find a solution.

Indeed, if your sound-card permits it, it is better to use float 32 resolution if you apply DSP's.
Even if the file was encoded into 16 bit integer (uos will do the conversion).

But if you want to save to wav file, only integer 16 or 32 are permitted (not float 32).

By the way, if you do not apply any DSP, the audio quality is the same with integer 32 or float 32 resolution.

But when you apply DSP, the result is better with float32 than integer32 (that must be rounded).

Fre;D