search for: speex_decoder_ctl

Displaying 20 results from an estimated 103 matches for "speex_decoder_ctl".

2013 May 09
1
Moving from Speex to Opus (question 2)
...x.h" #include "spxcodec.h" #define MAX_FRAME_SIZE 2000 #define MAX_FRAME_BYTES 2000 CSpxCodec::CSpxCodec() : enh(1), rate(8000) { } CSpxCodec::~CSpxCodec() { } void CSpxCodec::Init() { speex_bits_init(&bits); decstate = speex_decoder_init(&speex_nb_mode); speex_decoder_ctl(decstate, SPEEX_SET_SAMPLING_RATE, &rate); speex_decoder_ctl(decstate, SPEEX_SET_ENH, &enh); int iFrameSize=0; speex_decoder_ctl(decstate, SPEEX_GET_FRAME_SIZE, &iFrameSize); } void CSpxCodec::Free() { speex_bits_destroy(&bits); speex_decoder_destroy(decs...
2005 Dec 06
1
problems decoding speex... please help
...) { printf ("sampleDEC.exe started!\n"); /**/ int nBytes, FrameSize, BitRate; FILE *fin, *fout; char *inFile, *outFile, *PEnhancement; short out [500]; char cbits [500]; void *state; SpeexBits bits; state = speex_decoder_init (&speex_nb_mode); speex_decoder_ctl (state, SPEEX_GET_FRAME_SIZE, &FrameSize); inFile = argv [1]; outFile = argv [2]; PEnhancement = argv [3]; fout = fopen (outFile, "w"); if (fout == NULL) { printf ("Error creating file\n"); return 1; } printf ("Successfu...
2004 Aug 06
2
SPEEX_GET_SAMPLING_RATE of encoder is wrong
...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 (*((SpeexM...
2009 Sep 02
3
voice sound like robot voice :)
...c::setupDecoder() { // catch invalid sample rates resulting in invalid mode if ( !pMode ) return; // assert( ( pCodecDecoderState == NULL ) && "decoder already initialized" ); // int enabled = 1; // pCodecDecoderState = speex_decoder_init( pMode ); speex_decoder_ctl( pCodecDecoderState, SPEEX_SET_SAMPLING_RATE, &sampleRate ); speex_decoder_ctl( pCodecDecoderState, SPEEX_GET_FRAME_SIZE, &decoderFrameSize ); speex_decoder_ctl( pCodecDecoderState, SPEEX_SET_ENH, &enabled ); // speex_bits_init( &codecBits ); } uint TVoiceCodec::encode(...
2004 Aug 06
1
One Minor Bug (Typo) in Speex 1.0
Speex 1.0 - in file sb_celp.c line 218 change speex_decoder_ctl(...) to speex_encoder_ctl(...): void *sb_encoder_init(SpeexMode *m) { . . . --> speex_decoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate); // Replace <-- speex_encoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate); st->samp...
2006 Feb 10
2
About wideband encode
...9;? When I set quality '9' / high_mode '3' / low_mode '6', encode as like quality is '8'. And what does high/low mode value in encoding process? 2) callback.callback_id = SPEEX_INBAND_CHAR; callback.func = speex_std_char_handler; callback.data = stderr; speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); callback.callback_id = SPEEX_INBAND_MODE_REQUEST; callback.func = speex_std_mode_request_handler; callback.data = st; speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback); Are these codes essential for encoding? I don't know role of a...
2007 Dec 21
1
Continous decoding of several audio files without destroying speex_decoder
...peex decoder API. Basically, we initialize speex decoder only once and just reset the decoder before we decoding another file. Do we need to intialize speex decoder and destory decoder for each audio file decoding ? Here is current pseudo code. main() { m_speex = speex_decoder_init(speex_nb_mode); speex_decoder_ctl(m_speex, SPEEX_SET_ENH, &tmp); speex_bits_init(&m_bits); while(end of files) { speex_decoder_ctl(m_speex, SPEEX_RESET_STATE, &tmp); speex_bits_reset(&m_bits); OpenFile(speex audio file); while(end of file) { fread(speex frame); speex_bits_read_from();...
2006 Mar 20
1
ARM7 Speex decoder
...e .ogg file from and external MMC card, I can only red a limited memory block 1) Can I decode only a block of a speex file at time ? /*Create a new decoder state in narrowband mode*/ state = speex_decoder_init(&speex_nb_mode); /*Set the perceptual enhancement on*/ tmp=1; speex_decoder_ctl(state, SPEEX_SET_ENH, &tmp); /* Get frame size */ speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &nbBytes); /*Initialization of the structure that holds the bits*/ speex_bits_init(&bits); do { lb = file_read(&file, nbBytes, (void *)cbits)...
2009 Sep 03
1
Speex-dev Digest, Vol 64, Issue 2
...> > return; > > // > > assert( ( pCodecDecoderState == NULL ) && "decoder already > initialized" > > ); > > // > > int enabled = 1; > > // > > pCodecDecoderState = speex_decoder_init( pMode ); > > speex_decoder_ctl( pCodecDecoderState, SPEEX_SET_SAMPLING_RATE, > > &sampleRate ); > > speex_decoder_ctl( pCodecDecoderState, SPEEX_GET_FRAME_SIZE, > > &decoderFrameSize ); > > speex_decoder_ctl( pCodecDecoderState, SPEEX_SET_ENH, > > &enabled ); > > // > &...
2010 Mar 19
4
Speex in flash player: how to work with?
Nicer way: void* speexState = speex_encoder_init(&speex_wb_mode); int speexFrameSize, speexRate; speex_encoder_ctl(speexState, SPEEX_GET_FRAME_SIZE, &speexFrameSize); speex_encoder_ctl(speexState, SPEEX_GET_SAMPLING_RATE, &speexRate); SpeexPreprocessState* speexPreprocessState = speex_preprocess_state_init(speexFrameSize, speexRate); Jozsef -----Original Message----- From: Max
2005 Oct 17
6
Error Executing sampledec in VC++
...tion at 0x004010fa in SPXDEC.exe: 0xC0000005: Access violation reading location 0x0000000c. It looks like the same error. I've attached the code below Thanks, Mon Portion of the revised code: decstate = speex_decoder_init (&speex_nb_mode); // Set default options for decoding: temp = 1; speex_decoder_ctl(decstate, SPEEX_SET_ENH, &temp); // Initialize spxbits (structure SpeexBits) speex_bits_init (&spxbits); while (!(feof(fo))) // this is where the problem starts { fread (&nbBytes, sizeof(int), 1, fo); fread (cbits, 1, nbBytes, fo); cout << "1"; // just to see whether...
2004 Aug 06
1
SPEEX_GET_SAMPLING_RATE of encoder is wrong
...t; > 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...
2004 Aug 06
0
About sample code
...er_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &frame_size); speex_encoder_ctl(enc_state, SPEEX_SET_COMPLEXITY, &complexity); speex_encoder_ctl(enc_state, SPEEX_SET_SAMPLING_RATE, &rate); int tmp=8; speex_encoder_ctl(enc_state,SPEEX_SET_QUALITY,&tmp); // set option for decoder speex_decoder_ctl(dec_state, SPEEX_GET_FRAME_SIZE, &frame_size); speex_decoder_ctl(dec_state, SPEEX_SET_SAMPLING_RATE, &rate); int tmp2=1; speex_decoder_ctl(dec_state,SPEEX_SET_ENH,&tmp2); } SpeeXCodec::~SpeeXCodec() { // Free encoder resource speex_bits_destroy(&enbits); speex_encoder_dest...
2009 Sep 03
0
voice sound like robot voice :)
...es resulting in invalid mode > if ( !pMode ) > return; > // > assert( ( pCodecDecoderState == NULL ) && "decoder already initialized" > ); > // > int enabled = 1; > // > pCodecDecoderState = speex_decoder_init( pMode ); > speex_decoder_ctl( pCodecDecoderState, SPEEX_SET_SAMPLING_RATE, > &sampleRate ); > speex_decoder_ctl( pCodecDecoderState, SPEEX_GET_FRAME_SIZE, > &decoderFrameSize ); > speex_decoder_ctl( pCodecDecoderState, SPEEX_SET_ENH, > &enabled ); > // > speex_bits_init( &codecB...
2006 May 21
2
Re: High pitched whine with Speex
...pretty much all my speex code: ENCODING INIT: channel->enc_state=speex_encoder_init(&speex_nb_mode); speex_encoder_ctl(channel->enc_state, SPEEX_GET_FRAME_SIZE, &channel->speexOutgoingFrameSampleCount); DECODING INIT: channel->dec_state=speex_decoder_init(&speex_nb_mode); speex_decoder_ctl(channel->dec_state, SPEEX_GET_FRAME_SIZE, &channel->speexIncomingFrameSampleCount); ENCODING: speex_encode(channel->enc_state, (float *) inputBuffer, &speexBits); bytesWritten = speex_bits_write(&speexBits, tempOutput+1, 2048-1); DECODING: speex_bits_read_from(&speexBits...
2005 Oct 17
3
Error Executing sampledec in VC++
...\n"; fs = fopen ("pcmfile", "wb"); if (fs == NULL) cout << "Error creating file!\n"; else cout << "File created!\n"; while (!(feof(fo))) { decstate = speex_decoder_init (&speex_nb_mode); // Set default options for decoding: temp = 1; speex_decoder_ctl(decstate, SPEEX_SET_ENH, &temp); // Initialize spxbits (structure SpeexBits) speex_bits_init (&spxbits); fread (&nbBytes, sizeof(int), 1, fo); fread (cbits, 1, nbBytes, fo); cout << "1"; // just to see whether the loop iterates speex_bits_read_from (&spxbits, c...
2010 Jul 20
2
[SPAM] [BombData][alltestmode] Re: Speex Echo Cancellation
As for me - speex_echo_cancellation is a better choise. Try using it in capture thread instead of those speex_echo_capture and speex_echo_playback functions. And please, describe your problem in details. Cause the fact that you "didn get echo cancellation" doesn't mean you are doing smth wrong. Regards, Anton A. Shpakovsky -----Original Message----- From: speex-dev-bounces at
2008 Feb 21
2
Determine number of 20ms frames in packet - without decoding
...may be used in VBR or DTX mode? > At least that's why I kept it. Of course it *can* be used (and needs fixing). It just seems few people did :-) > So, what's the next step towards intergartion? I guess it should > be somehow made available from Speex API level, e.g. with > new speex_decoder_ctl() or speex_lib_ctl() request? I have > no idea about the best way here, and would appreciate your > advices. I don't think it should be a _ctl() call because there's too much potential for confusion. I would just keep it as a separate API call like you have. I'd tend to put it in...
2004 Aug 06
0
Invalid mode encountered: corrupted stream?
...omp); speex_encoder_ctl(enc_state,SPEEX_SET_QUALITY,&quality); speex_encoder_ctl(enc_state,SPEEX_SET_BITRATE, &enc_bitrate); speex_encoder_ctl(enc_state,SPEEX_SET_DTX, &vero); <p> //DECODER speex_bits_init(&dec_bits); dec_state = speex_decoder_init(&speex_nb_mode); speex_decoder_ctl(dec_state, SPEEX_RESET_STATE,NULL); speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &falso); } void SpeexEncode(short *samples, char *encoded) { speex_bits_reset(&enc_bits); speex_encode(enc_state, samples, &enc_bits); enc_nbBytes = speex_bits_write(&enc_bits, encoded, 20); } void...
2004 Aug 06
0
SPEEX_GET_SAMPLING_RATE of encoder is wrong
...LING_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, vo...