[Speex-dev] a problem about decode !help me!

hfbgk hfbgk at 163.com
Tue Jul 24 20:07:47 PDT 2007


I try test speex in windows.When I try decode a test frames of data encoded by speexenc.exe app.The defrence is the decoded data by speexdec.exe is not same by my app.Here is my test code:what errors I made? Thank you! (My app user speex-1.2beta1 library) int frame_size;
 int nbBytes=0;
 int lookahead; int sampleRate=8000;
 SpeexBits bits;
 void *dec_state;
 bEnhance=1;
 float output[2000];
 char  intput[]=
 {
       0X2f ,0x87 ,0xa2 ,0xee ,0x4f ,0x42 ,0x7c ,0x7f ,0xff ,0xff ,0xff ,0xff ,0xff ,0x8c ,0x12 ,0x3f ,0xfd ,0x3f ,0xff
  ,0xff ,0xff ,0xeb ,0x3e ,0xfa ,0x84 ,0x97 ,0x4e ,0x1c ,0x81 ,0x8a ,0xcc ,0xfa ,0x5a ,0xef ,0x07 ,0xbf ,0x9b ,0x67
 };
 dec_state = speex_decoder_init(&speex_nb_mode);
 speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &bEnhance);
 speex_bits_init(&bits);
 speex_decoder_ctl(dec_state, SPEEX_SET_SAMPLING_RATE, &sampleRate);
 /////////////////////////////////////////
 speex_bits_read_from(&bits, intput, 38);
 ret=speex_decode(dec_state, &bits, output);
 *outputBufSize=frame_size;
 /////////////////////////////////////////
 speex_bits_destroy(&bits);
 speex_decoder_destroy(dec_state); My result in output is:{ [0] 0 short
 [1] 0 short
 [2] 0 short
 [3] 0 short
 [4] 0 short
 [5] 0 short
 [6] 0 short
 [7] 0 short
 [8] 0 short
 [9] 0 short
 [10] 0 short
 [11] 0 short
 [12] 0 short
 [13] 0 short
 [14] 0 short
 [15] 0 short
 [16] 0 short
 [17] 0 short
 [18] 0 short
 [19] 0 short
 [20] 0 short
 [21] 0 short
 [22] 0 short
 [23] 0 short
 [24] 0 short
 [25] 0 short
 [26] 0 short
 [27] 0 short
 [28] 0 short
 [29] 0 short
 [30] 0 short
 [31] 0 short
 [32] 0 short
 [33] 0 short
 [34] 0 short
 [35] 0 short
 [36] 0 short
 [37] 0 short
 [38] 0 short
 [39] 0 short
 [40] 0 short
 [41] 0 short
 [42] 0 short
 [43] 0 short
 [44] 0 short
 [45] 0 short
 [46] 0 short
 [47] 0 short
 [48] 1 short
 [49] 0 short
 [50] 0 short
 [51] 0 short
 [52] 0 short
 [53] 1 short
 [54] 0 short
 [55] 0 short
 [56] 0 short
 [57] 0 short
 [58] 0 short
 [59] 0 short
 [60] 0 short
 [61] 0 short
 [62] 0 short
 [63] 0 short
 [64] 0 short
 [65] 0 short
 [66] 0 short
 [67] 0 short
 [68] 0 short
 [69] 0 short
 [70] 0 short
 [71] 0 short
 [72] 0 short
 [73] 0 short
 [74] 0 short
 [75] 0 short
 [76] 0 short
 [77] 0 short
 [78] 0 short
 [79] 0 short
 [80] 0 short
 [81] 0 short
 [82] 0 short
 [83] 0 short
 [84] 0 short
 [85] 0 short
 [86] 0 short
 [87] 0 short
 [88] 0 short
 [89] 0 short
 [90] -3 short
 [91] -1 short
 [92] 0 short
 [93] -3 short
 [94] 1 short
 [95] 1 short
 [96] 0 short
 [97] 0 short
 [98] 1 short
 [99] 1 short
 [100] 1 short
 [101] 1 short
 [102] 1 short
 [103] 1 short
 [104] 1 short
 [105] 0 short
 [106] 0 short
 [107] 0 short
 [108] 0 short
 [109] 0 short
 [110] -1 short
 [111] -1 short
 [112] 0 short
 [113] 1 short
 [114] 1 short
 [115] 0 short
 [116] -1 short
 [117] 0 short
 [118] 1 short
 [119] 1 short
 [120] 70 short
 [121] -12 short
 [122] -46 short
 [123] 34 short
 [124] -27 short
 [125] 70 short
 [126] 101 short
 [127] -32 short
 [128] 34 short
 [129] -27 short
 [130] -115 short
 [131] 2 short
 [132] 29 short
 [133] 6 short
 [134] 19 short
 [135] -52 short
 [136] -190 short
 [137] -166 short
 [138] -46 short
 [139] 15 short
 [140] 101 short
 [141] 172 short
 [142] 198 short
 [143] 185 short
 [144] 186 short
 [145] 112 short
 [146] 81 short
 [147] -54 short
 [148] -30 short
 [149] -68 short
 [150] 23 short
 [151] 32 short
 [152] -193 short
 [153] -264 short
 [154] -137 short
 [155] -139 short
 [156] 37 short
 [157] -46 short
 [158] -229 short
 [159] 26 short
}The speexdec.exe's result is:{ [0] -3  short [1] -3 short
 [2] -3 short
 [3] -2 short
 [4] 0 short
 [5] -1 short
 [6] -2 short
 [7] -1 short
 [8] 0 short
 [9] 1 short
 [10] 2 short
 [11] 2 short
 [12] 1 short
 [13] 0 short
 [14] 3 short
 [15] 4 short
 [16] 0 short
 [17] 1 short
 [18] 4 short
 [19] 1 short
 [20] 1 short
 [21] 2 short
 [22] 1 short
 [23] 2 short
 [24] 2 short
 [25] 2 short
 [26] 0 short
 [27] 1 short
 [28] 0 short
 [29] -1 short
 [30] -2 short
 [31] -3 short
 [32] -2 short
 [33] -2 short
 [34] -1 short
 [35] -1 short
 [36] 0 short
 [37] 1 short
 [38] 1 short
 [39] 0 short
 [40] 0 short
 [41] 0 short
 [42] 1 short
 [43] 0 short
 [44] 0 short
 [45] -1 short
 [46] -1 short
 [47] 0 short
 [48] -1 short
 [49] -2 short
 [50] -3 short
 [51] -3 short
 [52] -2 short
 [53] -1 short
 [54] -1 short
 [55] -1 short
 [56] -1 short
 [57] 0 short
 [58] 0 short
 [59] 1 short
 [60] 1 short
 [61] 1 short
 [62] 1 short
 [63] 1 short
 [64] 2 short
 [65] 1 short
 [66] 0 short
 [67] 1 short
 [68] 2 short
 [69] 1 short
 [70] 0 short
 [71] 0 short
 [72] 1 short
 [73] 1 short
 [74] 1 short
 [75] 0 short
 [76] 0 short
 [77] 1 short
 [78] 1 short
 [79] 0 short
 [80] -2 short
 [81] -1 short
 [82] -1 short
 [83] 2 short
 [84] 2 short
 [85] 1 short
 [86] -1 short
 [87] -4 short
 [88] 1 short
 [89] 3 short
 [90] -4 short
 [91] -3 short
 [92] 1 short
 [93] -2 short
 [94] -1 short
 [95] 0 short
 [96] 2 short
 [97] 1 short
 [98] 0 short
 [99] 3 short
 [100] 2 short
 [101] 1 short
 [102] 3 short
 [103] -2 short
 [104] -7 short
 [105] -6 short
 [106] -6 short
 [107] -6 short
 [108] -3 short
 [109] 1 short
 [110] 0 short
 [111] -3 short
 [112] -1 short
 [113] 3 short
 [114] 4 short
 [115] 7 short
 [116] 4 short
 [117] 1 short
 [118] 1 short
 [119] 6 short
 [120] 74 short
 [121] -9 short
 [122] -40 short
 [123] 42 short
 [124] -27 short
 [125] 77 short
 [126] 104 short
 [127] -23 short
 [128] 49 short
 [129] -25 short
 [130] -104 short
 [131] 4 short
 [132] 25 short
 [133] 9 short
 [134] 9 short
 [135] -66 short
 [136] -198 short
 [137] -177 short
 [138] -57 short
 [139] 6 short
 [140] 97 short
 [141] 170 short
 [142] 200 short
 [143] 187 short
 [144] 186 short
 [145] 116 short
 [146] 90 short
 [147] -41 short
 [148] -16 short
 [149] -57 short
 [150] 28 short
 [151] 38 short
 [152] -192 short
 [153] -258 short
 [154] -154 short
 [155] -158 short
 [156] 19 short
 [157] -66 short
 [158] -236 short
 [159] 14 short
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20070725/c5685ef5/attachment.html


More information about the Speex-dev mailing list