[Speex-dev] Sound distorted after normalized.

Conrad Parker conrad at metadecks.org
Wed Dec 29 16:27:51 PST 2004


On Wed, Dec 29, 2004 at 02:53:14PM +0800, illiminable wrote:
> Hmmm... sorry i mislead you Tay... i didn't realise my encoder 
> (libfishsound) was again shifting the data i gave it back to being 32767 
> based internally.

libspeex uses floats in the range +-32767

libfishsound is a simplified wrapper for libspeex and libvorbis, and
its interface uses floats in the range +-1.0. The reason is that that
is the conventional range used by most audio software (including
libvorbis, libsndfile, etc.). Hence, for its speex support,
libfishsound converts libspeex's floats into the +-1.0 range.

Conrad.
(libfishsound author)

> 
> Zen.
> ----- Original Message ----- 
> From: "Jean-Marc Valin" <Jean-Marc.Valin at USherbrooke.ca>
> To: "Tay YueWeng" <yueweng at yahoo.com>
> Cc: "speex" <speex-dev at xiph.org>
> Sent: Wednesday, December 29, 2004 1:04 PM
> Subject: Re: [Speex-dev] Sound distorted after normalized.
> 
> 
> >16 bit ints have a range of -32768 to 32767. If you divide
> >-32768 by 32767.0 you end up with -1.00003051850948 which
> >is a bad thing.
> >
> >Try normalizing with a value of 32768.0.
> 
> No. Speex expects values in the +-32767 range, not +-1.0. Just
> converting from int16 to float *is* the right thing to do.
> 
> Jean-Marc
> 
> -- 
> Jean-Marc Valin <Jean-Marc.Valin at USherbrooke.ca>
> Universit? de Sherbrooke
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
> 
> 
> 
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev


More information about the Speex-dev mailing list