Hey Jorge,

On 9/13/07, Jorge Ignacio Jiménez <[EMAIL PROTECTED]> wrote:
> int     frame.channels            (2)
> int     frame.samplerate          (44100)
> int     frame.size                (1024)

The most important thing for audio quality is the encoder's setting.
You spotted the three other parameters. Besides from these, there are
no others.

The frame.channels allows you to switch to mono, or 5 channels for
example. If you move to mono, you may save some CPU. However, this is
not much used and tested yet, so don't change that in production.

The infinite stream of audio data is split in samples, with
frame.samplerate samples per second. For performance, liquidsoap
doesn't compute the data sample-per-sample, but frame-per-frame. A
frame is a block of frame.size samples per channel. See
http://savonet.sourceforge.net/wiki/LiqConcepts for more details.

Increasing the frame.size may save some CPU as you noticed. It doesn't
change much of the output. For example user-requested skips and
track_insensitive switches are only performed on frame limits, so you
loose a bit of precision there if you increase the size. But it's
really meaningless unless you set the size to something huge, in which
case liquidsoap might stop working anyway. With a too large size,
output.rtp() starts complaining (it needs to send small packets over
the network) and I'm sure there is a limit for icecast outputs too.

Changing the frame.samplerate should not affect the speed of the
stream: I should test that when I get time, this is a bug! If you make
it really high you gain in precision, but there's no reason to set it
higher than the actual samplerate of your files. (If you make it a
multiple of your input files' samplerates and a multiple of the
outputs' samplerates, then the resamplings that occur at both ends may
be less quality-lossy, but the resampling algorithm is good anyway,
and probably only a few people would hear the difference.) A good and
simple rule, I think, is to set it to the highest samplerate of your
outputs: probably 44100Hz, the default.

Cheers.
-- 
David

Reply via email to