1 #include "soundpipe.h"
2 #include "md5.h"
3 #include "tap.h"
4 #include "test.h"
5
6 typedef struct {
7 sp_spa *wav;
8 sp_lpc *lpc;
9 } user_data;
10
t_lpc(sp_test * tst,sp_data * sp,const char * hash)11 int t_lpc(sp_test *tst, sp_data *sp, const char *hash)
12 {
13 uint32_t n;
14 int fail = 0;
15 user_data dt;
16 SPFLOAT diskin;
17 SPFLOAT out;
18
19 diskin = 0;
20 out = 0;
21 sp_lpc_create(&dt.lpc);
22 sp_lpc_init(sp, dt.lpc, 512);
23 sp_spa_create(&dt.wav);
24 sp_spa_init(sp, dt.wav, SAMPDIR "oneart.spa");
25
26
27 for(n = 0; n < tst->size; n++) {
28 sp_spa_compute(sp, dt.wav, NULL, &diskin);
29 sp_lpc_compute(sp, dt.lpc, &diskin, &out);
30
31 sp_test_add_sample(tst, out);
32 }
33
34 fail = sp_test_verify(tst, hash);
35
36 sp_spa_destroy(&dt.wav);
37 sp_lpc_destroy(&dt.lpc);
38
39 if(fail) return SP_NOT_OK;
40 else return SP_OK;
41 }
42