Displaying 20 results from an estimated 51 matches for "dec_state".
Did you mean:
desc_state
2005 Feb 09
2
encoding speex, (insanity looming)
...make it easyer to see. Any help would
be wonderful, think of it as an heroic act by saving me from a mental
break down. :)
Thanks,
David.
==== sample code ====
...
// encoder
void *enc_state;
SpeexBits enc_bits;
// decoder
void *dec_state;
SpeexBits dec_bits
// quaility and rate
int quality = 8, rate = 16000;
// setup encoder
speex_bits_init(&enc_bits);
enc_state = speex_encoder_init(&speex_wb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
spee...
2012 Mar 10
3
problem: The decoded frame is not as the original one
...lude<stdio.h>
#include"intel16.h"
#include <speex/speex.h>
#define FRAME_SIZE 160
#define MAX_NB_BYTES 25
SpeexBits bits;
void *enc_state;
int quality=4;??????
int nbBytes;
int byte_ptr;
int frame_size;
short frame[FRAME_SIZE];?
char outBuffer[20];
SpeexBits decBits;
void *dec_state;
short decFrame[FRAME_SIZE];
/*===========END ===============================*/
int z=0;
int frame_size;
int main (int argc,char **argv)
{
for( z=0;z<160;z++)
??? {
??? frame[z]=intel_theme[z];? //array of short from "intel16" header file
??? }
?printf("\n ====================...
2006 May 21
2
Re: High pitched whine with Speex
...4 byte floats.
My sample rate is 8000
Here's 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+...
2005 Oct 09
0
Fw: problem in encoder/decoder
...lete[] encodedstr;
result = NULL;
input_frame = NULL;
encodedstr = NULL;
return TRUE;
}
where pMsg->m_pBuffer is an UCHAR buffer containing recorded speech. and at
the end of encode it contains the encoded bytes.
BOOL DecodeSpeex(CVoiceMsg *pMsg)
{
SpeexBits bits;
void* dec_state;
// Initialize.
speex_bits_init(&bits);
dec_state = speex_decoder_init(&speex_nb_mode);
int frame_size = 0;
// get frame size.
speex_decoder_ctl(dec_state,SPEEX_GET_FRAME_SIZE,&frame_size);
int nbBytes = 0;
unsigned char *input_frame;
short *output_frame;
input_...
2004 Aug 06
0
About sample code
I write a sample code like speex provide , as follows:
SpeeXCodec::SpeeXCodec()
{
rate = 8000;
speex_bits_init(&enbits);
speex_bits_init(&debits);
enc_state = speex_encoder_init(&speex_nb_mode);
dec_state = speex_decoder_init(&speex_nb_mode);
// set option for encoder
speex_encoder_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_...
2005 Feb 09
1
encoding speex, (insanity looming)
...ain for your help,
David.
enc_state = speex_encoder_init(&speex_wb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
speex_encoder_ctl(enc_state, SPEEX_SET_SAMPLING_RATE, &rate);
// setup decoder
speex_bits_init(&dec_bits);
dec_state = speex_decoder_init(&speex_wb_mode);
On Wed, 9 Feb 2005 09:08:47 -0500, Tom Newbern <tnewbern@comcast.net> wrote:
> In short try calling speex_encode_int and speex_decode_int.
>
> The calls to speex_encode and speex_decode expects the data to be a floating
> point values....
2005 Feb 09
0
encoding speex, (insanity looming)
...make it easyer to see. Any help would
be wonderful, think of it as an heroic act by saving me from a mental
break down. :)
Thanks,
David.
==== sample code ====
...
// encoder
void *enc_state;
SpeexBits enc_bits;
// decoder
void *dec_state;
SpeexBits dec_bits
// quaility and rate
int quality = 8, rate = 16000;
// setup encoder
speex_bits_init(&enc_bits);
enc_state = speex_encoder_init(&speex_wb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
spee...
2004 Aug 06
0
Invalid mode encountered: corrupted stream?
...countered: corrupted stream?"
"Invalid wideband mode encountered: corrupted stream?"
The stream is not corrupted but i wish to know what those warning mean to
correct my code.
My encode and decode routines are those (libspeex 1.1.4):
SpeexBits enc_bits, dec_bits;
void *enc_state, *dec_state;
static int enc_nbBytes = 0;
static int comp = 1, quality = 5;
static int vero = 1, falso = 0;
static int enc_bitrate = 8000;
void SpeexInit (void)
{
//ENCODER
speex_bits_init(&enc_bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,SPEEX_RESET_STATE,NUL...
2009 Apr 13
0
encoding -> decoding doesnt work
...,
encodedBytes );
}
printf("\n\nTotally: %u\nper Item: %f\n\n", total,
(float)total/(amountSamples/frame_size) );
speex_bits_destroy(&bits);
speex_encoder_destroy(enc_state);
// ###########################
// decoding
// ###########################
SpeexBits dec_bits;
void *dec_state;
const SpeexMode *dec_mode;
dec_mode = speex_lib_get_mode (SPEEX_MODEID_WB);
speex_bits_init(&dec_bits);
// speex_nb_mode = 8kHz
// speex_wb_mode = 16 kHz
// speex_uwb_mode = 32 kHz
dec_state = speex_decoder_init(dec_mode);
frame_size = 0;
speex_decoder_ctl(dec_state,SPEEX_GET_FRAM...
2005 Feb 09
1
Trying to do windows encoding dll
...;body) returns 1...
The output I get is a big black screen...
Any suggestions?
Thanks and best regards,
Florian
(Stuttgart, GERMANY)
#include <windows.h>
#include "theora/theora.h"
theora_state enc_state;
int enc_width, enc_height;
ogg_stream_state enc_stream;
theora_state dec_state;
int dec_width, dec_height;
ogg_stream_state dec_stream;
__declspec (dllexport) void startenc(int width, int height, int bitrate)
{
ogg_stream_init(&enc_stream, 290482);
enc_width = width;
enc_height = height;
theora_info ti;
theora_info_init(&ti);
ti.width=width;
ti.height...
2012 Mar 11
0
problem: The decoded frame is not as the original one
...lude<stdio.h>
#include"intel16.h"
#include <speex/speex.h>
#define FRAME_SIZE 160
#define MAX_NB_BYTES 25
SpeexBits bits;
void *enc_state;
int quality=4;??????
int nbBytes;
int byte_ptr;
int frame_size;
short frame[FRAME_SIZE];?
char outBuffer[20];
SpeexBits decBits;
void *dec_state;
short
decFrame[FRAME_SIZE];
/*===========END ===============================*/
int z=0;
int frame_size;
int main (int argc,char **argv)
{
for( z=0;z<160;z++)
??? {
??? frame[z]=intel_theme[z];? //array of short from "intel16" header file
??? }
?printf("\n ===================...
2014 Jun 24
1
Speex Decoding Issue
...or reference, which consists of 61 encoded packets. I am also attaching the original WAV file.
In our application, we are trying to decode the embedded list of packets and playback using the microcontroller DA converter. Here I paste the function which handles this task:
SpeexBits bits;
void *dec_state;
int idx = 0;
// 160 decoded "samples"
short output_frame[SPEEX_NB_FRAME_SIZE];
// Getting the timer period from the Sample Rate of the original WAV file
float periodSec = 1.0f / (float) pstAudioBuffer->u.spx->dwSampleRate;
unsigned int periodMicroSec = (unsigned int) (...
2007 Jul 24
0
a problem about decode !help me!
...est frames of data encoded by speexenc.exe app.The defrence is the decoded data by speexdec.exe is not same by my app.Here is my test code:what errors I made? Thank you! (My app user speex-1.2beta1 library) int frame_size;
int nbBytes=0;
int lookahead; int sampleRate=8000;
SpeexBits bits;
void *dec_state;
bEnhance=1;
float output[2000];
char intput[]=
{
0X2f ,0x87 ,0xa2 ,0xee ,0x4f ,0x42 ,0x7c ,0x7f ,0xff ,0xff ,0xff ,0xff ,0xff ,0x8c ,0x12 ,0x3f ,0xfd ,0x3f ,0xff
,0xff ,0xff ,0xeb ,0x3e ,0xfa ,0x84 ,0x97 ,0x4e ,0x1c ,0x81 ,0x8a ,0xcc ,0xfa ,0x5a ,0xef ,0x07 ,0xbf ,0x9b ,0x67
};
dec...
2006 May 21
3
Re: High pitched whine with Speex
...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);
>> bytesW...
2010 Apr 10
2
Is Speex 1.0 and >=1.1 compatible?
...d like this for quite a while:
void AudioDecoderSpeex::writeEncodedSamples(void *buf, int size)
{
char *ptr = (char *)buf;
speex_bits_read_from(&bits, ptr, size);
float samples[frame_size];
#if SPEEX_MAJOR > 1 || (SPEEX_MAJOR == 1 && SPEEX_MINOR >= 1)
while (speex_decode(dec_state, &bits, samples) == 0)
#else
while ((speex_decode(dec_state, &bits, samples) == 0) &&
(speex_bits_remaining(&bits) > 0))
#endif
{
for (int i=0; i<frame_size; ++i)
{
samples[i] = samples [i] / 32767.0;
}
sinkWriteSamples(samples, frame_siz...
2010 Apr 11
2
Is Speex 1.0 and >=1.1 compatible?
...emaining bits can be anything from zero to
seven which I guess is normal. However, if I use the while loop below,
speex_decode will get called one more time (a total of five times) and that
seem to mess up the decoder state. The decoded audio get sort of "bubbly".
while ((speex_decode(dec_state,&bits, samples) == 0) &&
(speex_bits_remaining(&bits) >= 0)) {}
As far as I can see, the termination handling is not compatible when encoding
with, in this case, Speex ver 1.2rc1 and decoding with ver 1.0.5. Do you agree
or have I done something wrong in my code? T...
2009 Jan 20
0
VoIP with wavefrom and speex
...s_write(&bits, output, 200);
compr_length = bwrite_data(dest,compr_length,length); //writes 2 Byte into dest
memcpy(&dest[compr_length],output,length);
compr_length += length;
}
}
int audio_decode(WAVEHDR *dest, char *source, int srclen)
{
SpeexBits bits;
float output[160];
void *dec_state;
unsigned int i;
unsigned int reading_pos = 0;
unsigned short length;
unsigned int writing_pos = 0;
//Decodiern:
speex_bits_init(&bits);
dec_state = speex_decoder_init(&speex_nb_mode);
while(reading_pos < srclen && writing_pos < 512)
{
length = bget_data(source,re...
2012 Jul 15
0
iPhone distorted audio
...;bits);
*insize = speex_bits_write(&bits, outputBuffer, COMP_FRAME_SIZE);
speex_bits_destroy(&bits);
speex_encoder_destroy(enc_state);
return outputBuffer;
}
short *decodeSpeexWithBuffer(char *buffer) {
SpeexBits bits;
void *dec_state;
speex_bits_init(&bits);
dec_state = speex_decoder_init(&speex_nb_mode);
short *outTemp = (short *)malloc(FRAME_SIZE * 2);
speex_bits_read_from(&bits, buffer, COMP_FRAME_SIZE);
speex_decode_int(dec_state, &bits, outTemp);
speex_de...
2005 Feb 22
1
Win CE playback error
...ow are snippets of the coding.
Any help is appreciated.
//assuming data is stored as unsigned char buffer[160];
//Trying to use Fixed Point
#define FIXED_POINT
//initialization
SpeexBits bits;
speex_bits_init(&bits);
void *enc_state;
enc_state = speex_encoder_init(&speex_nb_mode);
void *dec_state;
dec_state = speex_decoder_init(&speex_nb_mode);
int i;
int x;
x = 5950; //set the bit-rate
speex_encoder_ctl(enc_state,SPEEX_SET_BITRATE,&x);
x = 8000; //set the sampling rate
speex_encoder_ctl(enc_state,SPEEX_SET_SAMPLING_RATE,&x);
x = 2; //set the quality
speex_encoder_ctl(e...
2005 Jun 23
1
Speex and DS
...reLockedBufferSize )
return E_FAIL; // Sanity check unhandled case
int size = dwDSOutputLockedBufferSize; //size in bytes
char* buffer = new char[size]; // buffer of bytes
CopyMemory( buffer, //fill the buffer
pDSCaptureLockedBuffer,
dwDSOutputLockedBufferSize );
void* enc_state; //states
void* dec_state;
#define FRAME_SIZE 160 //frame size in shorts,
#define BUFFERSIZE 4*FRAME_SIZE*sizeof(short)
#define SS sizeof(short)
short in[FRAME_SIZE];
float input[FRAME_SIZE];
int nbBytesenc;
int nbBytesdec;
SpeexBits bitsenc; //bits for encoding
SpeexBits bitsdec; //bits for decoding
enc_state = speex_...