Linuxg729 audio compression, high noise-general Linux technology-Linux technology and application information, the following is a detailed description. Experts in the altar asked for a question:
I downloaded the g729 standard algorithm on the itu website and compressed the pcm speech and sent it via udp. On the encode side, I dumped the compressed speech file and decoded it with a tool, after encoding is found
The speech quality is very poor, and it is noisy. Ask for help here.
My processing process is:
Encode pcm twice, 80 bit at a time
Assert (readLen/4 = 80 );
G729_encode_oneframe (short *) buff, readLen/4, sendbuf + hdrlen, & g729_one_frame_size );
Assert (g729_one_frame_size = G729_ONE_FRAME_SIZE); // G729_ONE_FRAME_SIZE = 10
G729_encode_oneframe (short *) buff) + readLen/4, readLen/4, sendbuf + hdrlen + g729_one_frame_size, & g729_one_frame_size );
Assert (g729_one_frame_size = G729_ONE_FRAME_SIZE );
PS: g729_encode_oneframe function:
Int g729_encode_oneframe (Word16 * pcm_src, Word16 src_len, unsigned char * dst, Word16 * dst_len_ptr)
{
Extern Word16 * new_speech;/* Pointer to new speech data */
Word16 prm [PRM_SIZE + 1];/* Analysis parameters .*/
Word16 serial [SERIAL_SIZE];/* Output bitstream buffer */
Word16 syn [L_FRAME];/* Buffer for synthesis speech */
Word16 I;/* frame counter */
/* For G.729B */
Word16 nb_words;
If (L_FRAME! = Src_len)
{
LOGD ("pcm src is wrong len is not 80 ");
Return 1;
}
LOGD ("g729 encdoe one frame % d len", src_len );
For (I = 0; I = (Word16) 0;
/* Loop for each "L_FRAME" speech data .*/
Memcpy (new_speech, pcm_src, sizeof (Word16) * src_len);/* network order problems may exist */
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service