{"id":3754,"date":"2014-03-30T05:21:38","date_gmt":"2014-03-30T05:21:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-speex-collection-of-common-programming-errors\/"},"modified":"2014-03-30T05:21:38","modified_gmt":"2014-03-30T05:21:38","slug":"problem-about-speex-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-speex-collection-of-common-programming-errors\/","title":{"rendered":"problem about speex-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/rrqz3.jpg?s=32&amp;g=1\" \/><br \/>\nNREZ<br \/>\nios memory-leaks instruments speex<br \/>\nI&#8217;ve been using Speex for a while now. Lately I discovered my app crashes sometimes during Speex encoding. When trying to discover where the problem comes from I discovered that Speex is leaking always and take huge amount of memory every time I used it.I call speex_resampler_init it calls speex_resampler_init_frac -&gt; update_filter -&gt; speex_alloc and it leaks. Can easily see that on instruments:I&#8217;m using precompiled Speex(1.2rc1) for iOS from here.Am I doing something wrong?Please help.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fc3def070075447ea19e1ea70afcec1b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJ.N.<br \/>\nc++ c speex<br \/>\nusing speex_resampler_process_interleaved_int() in libspeex leads to crash, any help would be appreciated. I have to upsample from 16000 to 22050 ,below is my code:spx_uint32_t buf_len = arg-&gt;count; \/\/ arg is a struct which contains data buffer spx_uint32_t bufout_len = ((buf_len * 22050\/16000) + 1); short *bufout = (short *)malloc(bufout_len); short *inbuf = (short *)arg-&gt;buf; int speex_err = 0; mspeex_src_state = speex_resampler_init(2,16000,22050,4,&amp;speex_err); speex_err = speex_re<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/seWnM.jpg?s=32&amp;g=1\" \/><br \/>\nMohsen Afshin<br \/>\nandroid memory-leaks android-ndk speex<br \/>\nI&#8217;m trying to decode Speex encoded audio files using Speex library but I always get ArrayIndexOutOfBoundsExceptionJNIEXPORT jint JNICALL Java_com_app_shared_Speex_decode(JNIEnv *env, jobject obj, jbyteArray encoded, jshortArray lin, jint size) {jbyte buffer[dec_frame_size ];jshort output_buffer[dec_frame_size ];jsize encoded_length = size;if (!codec_open)return 0;env-&gt;GetByteArrayRegion(encoded, rtp_header, encoded_length, buffer);\/* jboolean isCopy;jbyte* data = env-&gt;GetByteArrayElements<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2418cf397adaa4f72547f14e61348028?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nStrilanc<br \/>\nc undefined-behavior speex<br \/>\nWhile trying to debug a problem I&#8217;m having using Speex, I noticed that it (well, not just speex, but some example code as well) does the following:Return a pointer to EncState from an initialization function Cast that pointer to a void pointer Store the void pointer (elsewhere) Cast the void pointer to a pointer to pointer to SpeexMode Dereference the pointerIt so happens that the definition of EncState starts with a field of type SpeexMode*, and so the integer values of a pointer to the first f<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ef1a6d68122b3abb128184f3e2921b8e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEmployed Russian<br \/>\nlinux linker ld static-linking speex<br \/>\nI need your help about this problem if anyone has info.I have configured speex1.2rc1 for xscale-elf (ARM architecture) ,then executed make and make install. So, I obtained libspeex.a in the \/usr\/local\/lib with libogg.a compiled as well. but i when i link the library to my program (by adding LDFLAGS += -lspeex -lm), and try to compile, i get this error:\/usr\/lib\/gcc\/xscale-elf\/3.4.3\/..\/..\/..\/..\/xscale-elf\/bin\/ld: cannot find -lspeex collect2: ld returned 1 exit status make: *** [exe0] Error 1I pas<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c04de48a5a5d7f46fd0bafac4c112e5a?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nTheSquad<br \/>\nios audiounit speex<br \/>\nI&#8217;m trying to encode\/decode with speex, when I do not, the audio is loud and clear, but when I encode\/decode to test audio quality, I get a really poor audio quality and a robotic sound.Here&#8217;s my init audio method : #define AUDIO_QUALITY 10 &#8211; (void) initAudio {try { \/\/SPEEX CONFIGspeex_bits_init(&amp;bits_in);speex_bits_init(&amp;bits_out);enc_state = speex_encoder_init(&amp;speex_nb_mode);dec_state = speex_decoder_init(&amp;speex_nb_mode);int quality = AUDIO_QUALITY;speex_encoder_ctl(enc_stat<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/483bc373a2924e9cea924dba1a76ba8b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhsiltala<br \/>\njava audio speex jspeex nspeex<br \/>\nAs topic states, I have no problem in encoding audio in Windows Phone 7 with NSpeex(v1.1.1, uses Speex v1.2rc1). I have verified this by first encoding a stream, and then right after decoding it back again, add wav headers and send it back to server on which the wav plays just fine. But if I send the encoded stream to server and try to decode it with JSpeex(v0.9.7, uses Speex v1.0.3) I only get StreamCorruptedExceptions of different sorts with fiddling with the decoding settings.Am I hitting ver<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NREZ ios memory-leaks instruments speex I&#8217;ve been using Speex for a while now. Lately I discovered my app crashes sometimes during Speex encoding. When trying to discover where the problem comes from I discovered that Speex is leaking always and take huge amount of memory every time I used it.I call speex_resampler_init it calls speex_resampler_init_frac [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3754","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3754"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3754\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}