Displaying 6 results from an estimated 6 matches for "spx_frame_size_".
2010 Apr 14
3
Decoded output buffer size
...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_,
spx_enc_frame_,
spx_frame_size_);
inBuff+= spx_frame_siz...
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 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
...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_,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?spx_enc_frame_,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?spx_frame_si...
2010 Apr 15
2
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?
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
...= 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
but the number of frames in a packet is...