Re: What's the value range of float samples?
Nikos Chantziaras <[email protected]> Fri, 11 Jan 2013 18:19:18 +0200
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.general |
|---|---|
| Organization | Lucas Barks |
| Message-ID | <[email protected]> |
That only works for known files though, where you know beforehand that the scale factor is going to be 0.9. On 10/01/13 18:17, Joost van Dongen wrote: > We had audible problems with this in both Swords & Soldiers and > Awesomenauts. As Paul suggested, we worked around it by simply > multiplying all our samples to get them back in the -1,1 range. We > multiply by something like 0.9 or 0.99, don't remember the number exactly. > > > On 10 January 2013 17:10, Paul Martin <[email protected] > <mailto:[email protected]>> wrote: > > 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.