Displaying 4 results from an estimated 4 matches for "bufferframes".
2010 Apr 14
3
Decoded output buffer size
...the reply.
So, suppose I encode an audio buffer (8000 kHz, MONO, float) of 640 PCM
frames.
In output I have 4 speex frame of 20 byte each that I put in a RPT
payload of 80 bytes:
UINT CSpeexCodec::Encode( float *inBuff,
const char**outBuff,
UINT BufferFrames )
{
speex_encoder_ctl(spx_state_,
SPEEX_GET_FRAME_SIZE,
&spx_frame_size_);
while (BufferFrames>0)
{
speex_bits_reset(&spx_bits_);
speex_encode(spx_state_, inBuff, &spx_bits_);
nbBytes += speex_bits_write(&spx_bits_,...
2010 Apr 13
1
Another newbie question on encoding
...num ESpeexCodecType
{
SC_ENCODER,
SC_DECODER
};
enum ESpeexCodecMode
{
SC_NARROWBAND, // 8 kHz
SC_WIDEBAND, // 16 kHz
SC_ULTRAWIDEBAND // 32 kHz
};
CSpeexCodec();
~CSpeexCodec();
BOOL Init();
UINT Encode( sample_type *inBuff, char **outBuff, UINT BufferFrames );
private:
SpeexBits spx_bits_;
void* spx_state_;
UINT spx_quality_;
UINT frameSize_;
char* outBuffer_;
};
BOOL CSpeexCodec::Init()
{
spx_state_ = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(spx_state_, SPEEX_GET_FRAME_...
2010 Apr 14
2
Decoded output buffer size
Hi,
in a VoIP application, the endpoint A send speex payload to B.
B doesn't know how A acquire audio, it only know that the channel is
narrowband so, how can B know the size of the output buffer to pass to
the speex_decode()?
Thanks,
Daniele.
2010 Apr 14
0
Decoded output buffer size
...an audio buffer (8000 kHz, MONO, float) of 640 PCM
> frames.
> In output I have 4 speex frame of 20 byte each that I put in a RPT
> payload of 80 bytes:
>
> UINT CSpeexCodec::Encode( float *inBuff,
> ? ? ? ? ? ? ? ? ? ? ? ? ?const char**outBuff,
> ? ? ? ? ? ? ? ? ? ? ? ? ?UINT BufferFrames )
> {
> ?speex_encoder_ctl(spx_state_,
> ? ? ? ? ? ? ? ? ? ?SPEEX_GET_FRAME_SIZE,
> ? ? ? ? ? ? ? ? ? ?&spx_frame_size_);
>
> ?while (BufferFrames>0)
> ?{
> ? ?speex_bits_reset(&spx_bits_);
> ? ?speex_encode(spx_state_, inBuff, &spx_bits_);
> ? ?nbBytes...