[Vorbis] What's the value range of float samples?

Paul Martin pm at nowster.me.uk
Thu Jan 10 08:10:21 PST 2013


On Mon, Jan 07, 2013 at 11:50:20PM +0200, Nikos Chantziaras wrote:
> On 07/01/13 23:23, Paul Martin wrote:
> > On Mon, Jan 07, 2013 at 08:53:56PM +0200, Nikos Chantziaras wrote:
> >
> >> Apparently, there are Vorbis streams that use float samples with values
> >> in the range of [-32768, 32767]?
> >
> > GIGO.
> 
> So the answer is no?  Vorbis float values always have a nominal range of 
> [-1,1) and I can always clamp/clip to that?

If you feed in "normalized to full scale" values to any lossy encoder,
you are likely to get overshoots on decoding.  It's good to be aware
that this might happen and to do your volume scaling (playback gain)
in the floating point domain before you convert to integers.

You'll often notice this on YouTube videos where they clip audibly on
playback due to insufficient headroom.

-- 
Paul Martin <pm at nowster.me.uk>


More information about the Vorbis mailing list