<DIV>I try test speex in windows.When I try decode a test frames of data encoded by speexenc.exe app.</DIV>
<DIV>The defrence is the decoded data by speexdec.exe is not same by my appHere is my test code:</DIV>
<DIV>what errors I made? Thank you! (My app user speex-1.2beta1 library)</DIV>
<DIV> int frame_size;<BR> int nbBytes=0;<BR> int lookahead;</DIV>
<DIV> int sampleRate=8000;<BR> SpeexBits bits;<BR> void *dec_state;<BR> bEnhance=1;<BR> float output[2000];<BR> char intput[]=<BR> {<BR> 0X2f ,0x87 ,0xa2 ,0xee ,0x4f ,0x42 ,0x7c ,0x7f ,0xff ,0xff ,0xff ,0xff ,0xff ,0x8c ,0x12 ,0x3f ,0xfd ,0x3f ,0xff<BR> ,0xff ,0xff ,0xeb ,0x3e ,0xfa ,0x84 ,0x97 ,0x4e ,0x1c ,0x81 ,0x8a ,0xcc ,0xfa ,0x5a ,0xef ,0x07 ,0xbf ,0x9b ,0x67<BR> };<BR> dec_state = speex_decoder_init(&speex_nb_mode);<BR> speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &bEnhance);<BR> speex_bits_init(&bits);<BR> speex_decoder_ctl(dec_state, SPEEX_SET_SAMPLING_RATE, &sampleRate);<BR> /////////////////////////////////////////<BR> speex_bits_read_from(&bits, intput, 38);<BR> ret=speex_decode(dec_state, &bits, output);<BR> *outputBufSize=frame_size;<BR> /////////////////////////////////////////<BR> speex_bits_destroy(&bits);<BR> speex_decoder_destroy(dec_state);</DIV>
<DIV> </DIV>
<DIV>My result in output is:</DIV>
<DIV>{</DIV>
<DIV> [0] 0 short<BR> [1] 0 short<BR> [2] 0 short<BR> [3] 0 short<BR> [4] 0 short<BR> [5] 0 short<BR> [6] 0 short<BR> [7] 0 short<BR> [8] 0 short<BR> [9] 0 short<BR> [10] 0 short<BR> [11] 0 short<BR> [12] 0 short<BR> [13] 0 short<BR> [14] 0 short<BR> [15] 0 short<BR> [16] 0 short<BR> [17] 0 short<BR> [18] 0 short<BR> [19] 0 short<BR> [20] 0 short<BR> [21] 0 short<BR> [22] 0 short<BR> [23] 0 short<BR> [24] 0 short<BR> [25] 0 short<BR> [26] 0 short<BR> [27] 0 short<BR> [28] 0 short<BR> [29] 0 short<BR> [30] 0 short<BR> [31] 0 short<BR> [32] 0 short<BR> [33] 0 short<BR> [34] 0 short<BR> [35] 0 short<BR> [36] 0 short<BR> [37] 0 short<BR> [38] 0 short<BR> [39] 0 short<BR> [40] 0 short<BR> [41] 0 short<BR> [42] 0 short<BR> [43] 0 short<BR> [44] 0 short<BR> [45] 0 short<BR> [46] 0 short<BR> [47] 0 short<BR> [48] 1 short<BR> [49] 0 short<BR> [50] 0 short<BR> [51] 0 short<BR> [52] 0 short<BR> [53] 1 short<BR> [54] 0 short<BR> [55] 0 short<BR> [56] 0 short<BR> [57] 0 short<BR> [58] 0 short<BR> [59] 0 short<BR> [60] 0 short<BR> [61] 0 short<BR> [62] 0 short<BR> [63] 0 short<BR> [64] 0 short<BR> [65] 0 short<BR> [66] 0 short<BR> [67] 0 short<BR> [68] 0 short<BR> [69] 0 short<BR> [70] 0 short<BR> [71] 0 short<BR> [72] 0 short<BR> [73] 0 short<BR> [74] 0 short<BR> [75] 0 short<BR> [76] 0 short<BR> [77] 0 short<BR> [78] 0 short<BR> [79] 0 short<BR> [80] 0 short<BR> [81] 0 short<BR> [82] 0 short<BR> [83] 0 short<BR> [84] 0 short<BR> [85] 0 short<BR> [86] 0 short<BR> [87] 0 short<BR> [88] 0 short<BR> [89] 0 short<BR> [90] -3 short<BR> [91] -1 short<BR> [92] 0 short<BR> [93] -3 short<BR> [94] 1 short<BR> [95] 1 short<BR> [96] 0 short<BR> [97] 0 short<BR> [98] 1 short<BR> [99] 1 short<BR> [100] 1 short<BR> [101] 1 short<BR> [102] 1 short<BR> [103] 1 short<BR> [104] 1 short<BR> [105] 0 short<BR> [106] 0 short<BR> [107] 0 short<BR> [108] 0 short<BR> [109] 0 short<BR> [110] -1 short<BR> [111] -1 short<BR> [112] 0 short<BR> [113] 1 short<BR> [114] 1 short<BR> [115] 0 short<BR> [116] -1 short<BR> [117] 0 short<BR> [118] 1 short<BR> [119] 1 short<BR> [120] 70 short<BR> [121] -12 short<BR> [122] -46 short<BR> [123] 34 short<BR> [124] -27 short<BR> [125] 70 short<BR> [126] 101 short<BR> [127] -32 short<BR> [128] 34 short<BR> [129] -27 short<BR> [130] -115 short<BR> [131] 2 short<BR> [132] 29 short<BR> [133] 6 short<BR> [134] 19 short<BR> [135] -52 short<BR> [136] -190 short<BR> [137] -166 short<BR> [138] -46 short<BR> [139] 15 short<BR> [140] 101 short<BR> [141] 172 short<BR> [142] 198 short<BR> [143] 185 short<BR> [144] 186 short<BR> [145] 112 short<BR> [146] 81 short<BR> [147] -54 short<BR> [148] -30 short<BR> [149] -68 short<BR> [150] 23 short<BR> [151] 32 short<BR> [152] -193 short<BR> [153] -264 short<BR> [154] -137 short<BR> [155] -139 short<BR> [156] 37 short<BR> [157] -46 short<BR> [158] -229 short<BR> [159] 26 short<BR></DIV>
<DIV>}</DIV>
<DIV>The speexdec.exe's result is:</DIV>
<DIV>{</DIV>
<DIV> [0] -3 short</DIV>
<DIV> [1] -3 short<BR> [2] -3 short<BR> [3] -2 short<BR> [4] 0 short<BR> [5] -1 short<BR> [6] -2 short<BR> [7] -1 short<BR> [8] 0 short<BR> [9] 1 short<BR> [10] 2 short<BR> [11] 2 short<BR> [12] 1 short<BR> [13] 0 short<BR> [14] 3 short<BR> [15] 4 short<BR> [16] 0 short<BR> [17] 1 short<BR> [18] 4 short<BR> [19] 1 short<BR> [20] 1 short<BR> [21] 2 short<BR> [22] 1 short<BR> [23] 2 short<BR> [24] 2 short<BR> [25] 2 short<BR> [26] 0 short<BR> [27] 1 short<BR> [28] 0 short<BR> [29] -1 short<BR> [30] -2 short<BR> [31] -3 short<BR> [32] -2 short<BR> [33] -2 short<BR> [34] -1 short<BR> [35] -1 short<BR> [36] 0 short<BR> [37] 1 short<BR> [38] 1 short<BR> [39] 0 short<BR> [40] 0 short<BR> [41] 0 short<BR> [42] 1 short<BR> [43] 0 short<BR> [44] 0 short<BR> [45] -1 short<BR> [46] -1 short<BR> [47] 0 short<BR> [48] -1 short<BR> [49] -2 short<BR> [50] -3 short<BR> [51] -3 short<BR> [52] -2 short<BR> [53] -1 short<BR> [54] -1 short<BR> [55] -1 short<BR> [56] -1 short<BR> [57] 0 short<BR> [58] 0 short<BR> [59] 1 short<BR> [60] 1 short<BR> [61] 1 short<BR> [62] 1 short<BR> [63] 1 short<BR> [64] 2 short<BR> [65] 1 short<BR> [66] 0 short<BR> [67] 1 short<BR> [68] 2 short<BR> [69] 1 short<BR> [70] 0 short<BR> [71] 0 short<BR> [72] 1 short<BR> [73] 1 short<BR> [74] 1 short<BR> [75] 0 short<BR> [76] 0 short<BR> [77] 1 short<BR> [78] 1 short<BR> [79] 0 short<BR> [80] -2 short<BR> [81] -1 short<BR> [82] -1 short<BR> [83] 2 short<BR> [84] 2 short<BR> [85] 1 short<BR> [86] -1 short<BR> [87] -4 short<BR> [88] 1 short<BR> [89] 3 short<BR> [90] -4 short<BR> [91] -3 short<BR> [92] 1 short<BR> [93] -2 short<BR> [94] -1 short<BR> [95] 0 short<BR> [96] 2 short<BR> [97] 1 short<BR> [98] 0 short<BR> [99] 3 short<BR> [100] 2 short<BR> [101] 1 short<BR> [102] 3 short<BR> [103] -2 short<BR> [104] -7 short<BR> [105] -6 short<BR> [106] -6 short<BR> [107] -6 short<BR> [108] -3 short<BR> [109] 1 short<BR> [110] 0 short<BR> [111] -3 short<BR> [112] -1 short<BR> [113] 3 short<BR> [114] 4 short<BR> [115] 7 short<BR> [116] 4 short<BR> [117] 1 short<BR> [118] 1 short<BR> [119] 6 short<BR> [120] 74 short<BR> [121] -9 short<BR> [122] -40 short<BR> [123] 42 short<BR> [124] -27 short<BR> [125] 77 short<BR> [126] 104 short<BR> [127] -23 short<BR> [128] 49 short<BR> [129] -25 short<BR> [130] -104 short<BR> [131] 4 short<BR> [132] 25 short<BR> [133] 9 short<BR> [134] 9 short<BR> [135] -66 short<BR> [136] -198 short<BR> [137] -177 short<BR> [138] -57 short<BR> [139] 6 short<BR> [140] 97 short<BR> [141] 170 short<BR> [142] 200 short<BR> [143] 187 short<BR> [144] 186 short<BR> [145] 116 short<BR> [146] 90 short<BR> [147] -41 short<BR> [148] -16 short<BR> [149] -57 short<BR> [150] 28 short<BR> [151] 38 short<BR> [152] -192 short<BR> [153] -258 short<BR> [154] -154 short<BR> [155] -158 short<BR> [156] 19 short<BR> [157] -66 short<BR> [158] -236 short<BR> [159] 14 short<BR></DIV>
<DIV>}<BR></DIV><br><!-- footer --><br><hr>
<a style="font-size:14px;line-height:15px; color:#000; text-decoration:none" href="http://event.mail.163.com/chanel/xy3.htm?from=163_NO9" target="_blank"><span style="text-decoration:underline; color:blue">《大 话 西 游 3》 首 届 玩 家 见 面 会 即 将 在 广 州 召 开!敬 请 关 注 >></span> </a>