> 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@USherbrooke.ca> Universit? de Sherbrooke
Hi Jean-Marc, Sorry for miss-send to your personal email. So is there got any idea how to elimite the background bee sound and activate DTX correctly? Is it a bug in version 1.0.4? Should I use 1.1 instead? YueWeng --- Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca> wrote:> > 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@USherbrooke.ca> > Université de Sherbrooke > >__________________________________ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250
> > No. Speex expects values in the +-32767 range, not > +-1.0. Just > converting from int16 to float *is* the right thing > to do. >Please forget my previous message, I understand your point now: I should not normalized at all for speex. But how about activation of DTX? Which parameter should I set in encoder and decoder side so that DTX will work? __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250
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. Zen. ----- Original Message ----- From: "Jean-Marc Valin" <Jean-Marc.Valin@USherbrooke.ca> To: "Tay YueWeng" <yueweng@yahoo.com> Cc: "speex" <speex-dev@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@USherbrooke.ca> Universit? de Sherbrooke _______________________________________________ Speex-dev mailing list Speex-dev@xiph.org http://lists.xiph.org/mailman/listinfo/speex-dev
Dear all, I am using version 1.0.4 speex in win32. The data from the sound card is 16bit PCM with 8000 samples per second. I try to enable variable bit rate(VBR), discontinuous transmission, voice activity detection so that so that there is no traffic if it is silence. However, VBR seems to work but there is about 2kbytes~3kbytes per second of traffic eventhough I have unplug the microphone. I am wondering what other parameter needs to be set in order to allow discontinuous transmission. The following is my parameter that I have set. tmp = 1; speex_encoder_ctl(encoder_state, SPEEX_SET_VBR, &tmp); tmp = 1; speex_encoder_ctl(encoder_state, SPEEX_SET_DTX, &tmp); tmp = 1; speex_encoder_ctl(encoder_state, SPEEX_SET_VAD, &tmp); mode = 1; speex_encoder_ctl(encoder_state, SPEEX_SET_VBR_QUALITY, &mode); Thanks, YueWeng __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com
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@USherbrooke.ca> > To: "Tay YueWeng" <yueweng@yahoo.com> > Cc: "speex" <speex-dev@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@USherbrooke.ca> > Universit? de Sherbrooke > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev > > > > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev