Chris Flerackers
2004-Aug-06 15:02 UTC
[speex-dev] SPEEX_GET_SAMPLING_RATE of encoder is wrong
Hi, No, it only happens with speex_wb_mode. But like I said, it is because in wideband mode, the function sb_encoder_init is called and this function initializes the sampling rate using speex_*de*coder_ctl instead of speex_*en*coder_ctl In narrowband mode, the sampling rate is just initialized to 8000 st->sampling_rate=8000; BTW, I saw that my email was added to an existing thread instead of creating a new thread. Sorry about that. Best regards, Chris ----- Original Message ----- From: "Jean-Marc Valin" <Jean-Marc.Valin@USherbrooke.ca> To: "speex" <speex-dev@xiph.org>; <cflerackers@androme.be> Sent: Tuesday, March 30, 2004 1:01 AM Subject: Re: [speex-dev] SPEEX_GET_SAMPLING_RATE of encoder is wrong> Hi, > > Do you get that problem with speex_nb_mode too (or only speex_wb_mode)? > > Jean-Marc > > Le lun 29/03/2004 à 05:35, Chris Flerackers a écrit : > > Hi, > > > > I'm using speex 1.1.4 and when I query SPEEX_GET_SAMPLING_RATE > > as in > > speex_encoder_ctl ( m_pEncoderState, SPEEX_GET_SAMPLING_RATE, > > &m_SampleRate ); > > I get > > 2 > > The encoder is initialized with > > m_pEncoderState = speex_encoder_init ( &speex_wb_mode ); > > > > On the decoder side, the correct sampling rate is returned: > > m_pDecoderState = speex_decoder_init ( &speex_wb_mode ); > > speex_decoder_ctl ( m_pDecoderState, SPEEX_GET_SAMPLING_RATE, > > &m_SampleRate ); > > > > I debugged the encoder and the stack trace is as follows: > > -> speex_encoder_ctl ( m_pEncoderState, SPEEX_GET_SAMPLING_RATE, > > &m_SampleRate ); > > -> int speex_encoder_ctl(void *state, int request, void *ptr) > > return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); > > -> int sb_encoder_ctl(void *state, int request, void *ptr) > > ... > > case SPEEX_GET_SAMPLING_RATE: > > (*(int*)ptr)=st->sampling_rate; > > break; > > ... > > And st->sampling_rate is 2. > > > > I debugged some further and it seems: > > sb_encoder_init > > calls > > speex_decoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE,&st->sampling_rate);> > to get the sampling rate. I think it should be speex_encoder_ctl(otherwise> > SBEncState * is > > interpreted as SBDecState *). > > > > Best regards, > > Chris > > > > --- >8 ---- > > List archives: http://www.xiph.org/archives/ > > Ogg project homepage: http://www.xiph.org/ogg/ > > To unsubscribe from this list, send a message to'speex-dev-request@xiph.org'> > containing only the word 'unsubscribe' in the body. No subject isneeded.> > Unsubscribe messages sent to the list will be ignored/filtered. > -- > Jean-Marc Valin > http://www.xiph.org/~jm/ > LABORIUS > Université de Sherbrooke, Québec, Canada--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Chris Flerackers
2004-Aug-06 15:02 UTC
[speex-dev] SPEEX_GET_SAMPLING_RATE of encoder is wrong
Hi, I'm using speex 1.1.4 and when I query SPEEX_GET_SAMPLING_RATE as in speex_encoder_ctl ( m_pEncoderState, SPEEX_GET_SAMPLING_RATE, &m_SampleRate ); I get 2 The encoder is initialized with m_pEncoderState = speex_encoder_init ( &speex_wb_mode ); On the decoder side, the correct sampling rate is returned: m_pDecoderState = speex_decoder_init ( &speex_wb_mode ); speex_decoder_ctl ( m_pDecoderState, SPEEX_GET_SAMPLING_RATE, &m_SampleRate ); I debugged the encoder and the stack trace is as follows: -> speex_encoder_ctl ( m_pEncoderState, SPEEX_GET_SAMPLING_RATE, &m_SampleRate ); -> int speex_encoder_ctl(void *state, int request, void *ptr) return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); -> int sb_encoder_ctl(void *state, int request, void *ptr) ... case SPEEX_GET_SAMPLING_RATE: (*(int*)ptr)=st->sampling_rate; break; ... And st->sampling_rate is 2. I debugged some further and it seems: sb_encoder_init calls speex_decoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate); to get the sampling rate. I think it should be speex_encoder_ctl (otherwise SBEncState * is interpreted as SBDecState *). Best regards, Chris --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Jean-Marc Valin
2004-Aug-06 15:02 UTC
[speex-dev] SPEEX_GET_SAMPLING_RATE of encoder is wrong
Hi, Do you get that problem with speex_nb_mode too (or only speex_wb_mode)? Jean-Marc Le lun 29/03/2004 à 05:35, Chris Flerackers a écrit :> Hi, > > I'm using speex 1.1.4 and when I query SPEEX_GET_SAMPLING_RATE > as in > speex_encoder_ctl ( m_pEncoderState, SPEEX_GET_SAMPLING_RATE, > &m_SampleRate ); > I get > 2 > The encoder is initialized with > m_pEncoderState = speex_encoder_init ( &speex_wb_mode ); > > On the decoder side, the correct sampling rate is returned: > m_pDecoderState = speex_decoder_init ( &speex_wb_mode ); > speex_decoder_ctl ( m_pDecoderState, SPEEX_GET_SAMPLING_RATE, > &m_SampleRate ); > > I debugged the encoder and the stack trace is as follows: > -> speex_encoder_ctl ( m_pEncoderState, SPEEX_GET_SAMPLING_RATE, > &m_SampleRate ); > -> int speex_encoder_ctl(void *state, int request, void *ptr) > return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); > -> int sb_encoder_ctl(void *state, int request, void *ptr) > ... > case SPEEX_GET_SAMPLING_RATE: > (*(int*)ptr)=st->sampling_rate; > break; > ... > And st->sampling_rate is 2. > > I debugged some further and it seems: > sb_encoder_init > calls > speex_decoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate); > to get the sampling rate. I think it should be speex_encoder_ctl (otherwise > SBEncState * is > interpreted as SBDecState *). > > Best regards, > Chris > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > Ogg project homepage: http://www.xiph.org/ogg/ > To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered.-- Jean-Marc Valin http://www.xiph.org/~jm/ LABORIUS Université de Sherbrooke, Québec, Canada -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 190 bytes Desc: Ceci est une partie de message numériquement signée. Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20040329/5a1e3c9b/signature-0001.pgp