Displaying 4 results from an estimated 4 matches for "decoutbuffer_".
2010 Apr 13
1
Another newbie question on encoding
Hi,
I'm very sorry if those questions are repeated over and over, but I
cannot find a solution on the net.
I try to use speex to encode/decode voice to send over the network.
My doubts are:
1. The Bits_Per_Sample I use, are independent from the speex
encoding/decoding? (So...can I use 8, 16, 24..and so on?)
2. If I have this situation:
SAMPLE RATE.....: 8000
BITS PER SAMPLE.: 16
2010 Apr 15
2
Decoded output buffer size
...bits_read_from(&spx_bits_, payload, payload_len);
UINT nbBytes = speex_bits_remaining(&spx_bits_);
while (nbBytes>0)
{
speex_decode(spx_state_, &spx_bits_, spx_dec_frame_);
nbBytes = speex_bits_remaining(&spx_bits_);
// Save the speex frame into the buffer
DecOutBuffer_.Write(spx_dec_frame_, spx_frame_size_);
}
}
Any suggestion?
Thanks,
Daniele.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
iEYEARECAAYFAkvG1HUACgkQ/l+kMioSZwi/JgCfarhEpOljEFU3/zLrXO1BL+dq
TqUAn2P1YMuqbNz3K80pvP0fJ0JTCFos
=arZ0
-----END PGP SIGNATURE-----
2010 Apr 15
0
Decoded output buffer size
...ad, payload_len);
> ?UINT nbBytes = speex_bits_remaining(&spx_bits_);
>
> ?while (nbBytes>0)
> ?{
> ? ?speex_decode(spx_state_, &spx_bits_, spx_dec_frame_);
> ? ?nbBytes = speex_bits_remaining(&spx_bits_);
>
> ? ?// Save the speex frame into the buffer
> ? ?DecOutBuffer_.Write(spx_dec_frame_, spx_frame_size_);
> ?}
> }
>
> Any suggestion?
I think speex_decode() updates the number of bits remaining; here's what I use:
http://git.xiph.org/?p=libfishsound.git;a=blob;f=src/libfishsound/speex.c;h=ac435cba37354d85c2852ce4c7c6305490c0d585;hb=HEAD#l342
b...
2010 Apr 14
3
Decoded output buffer size
Il 14/04/2010 14:37, Randy Yates wrote:
>
> Usually a buffer is one frame of data, and a frame is 20 milliseconds.
> Since the sample rate is typically 8 kHz in narrowband mode, this
> corresponds to a buffer size of 160 samples.
Hi Randy, thanks for 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