diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-03-04 15:37:45 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-03-04 15:37:45 +0000 |
commit | 23b72a335dc2dfbec1145ffa6b886c5af925e588 (patch) | |
tree | eba320d470d821069bbd2604fd398923c50d6435 /pjmedia/src/test/wsola_test.c | |
parent | 93f91b36381a56608b372cc5bc99b17fe8d6174d (diff) |
More ticket #438: improve docs, added channel_count in wsola, etc.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1844 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/test/wsola_test.c')
-rw-r--r-- | pjmedia/src/test/wsola_test.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pjmedia/src/test/wsola_test.c b/pjmedia/src/test/wsola_test.c index 1258ff77..8c489fc8 100644 --- a/pjmedia/src/test/wsola_test.c +++ b/pjmedia/src/test/wsola_test.c @@ -5,7 +5,7 @@ #include <stdio.h> #include <assert.h> -#define CLOCK_RATE 44100 +#define CLOCK_RATE 16000 #define SAMPLES_PER_FRAME (10 * CLOCK_RATE / 1000) #define RESET() memset(buf1, 0, sizeof(buf1)), \ @@ -85,7 +85,7 @@ int expand(pj_pool_t *pool, const char *filein, const char *fileout, out = fopen(fileout, "wb"); if (!out) return 1; - pjmedia_wsola_create(pool, CLOCK_RATE, SAMPLES_PER_FRAME, 0, &wsola); + pjmedia_wsola_create(pool, CLOCK_RATE, SAMPLES_PER_FRAME, 1, 0, &wsola); samples = 0; elapsed.u64 = 0; @@ -200,7 +200,7 @@ int compress(pj_pool_t *pool, out = fopen(fileout, "wb"); if (!out) return 1; - pjmedia_wsola_create(pool, CLOCK_RATE, SAMPLES_PER_FRAME, 0, &wsola); + pjmedia_wsola_create(pool, CLOCK_RATE, SAMPLES_PER_FRAME, 1, 0, &wsola); elapsed.u64 = 0; @@ -319,7 +319,7 @@ int main() { pj_caching_pool cp; pj_pool_t *pool; - int rc; + int i, rc; //test_find_pitch(); @@ -329,8 +329,13 @@ int main() srand(2); - rc = expand(pool, "beet44.pcm", "output.pcm", 0, 0, 0); - //rc = compress(pool, "beet44.pcm", "output.pcm", 2); + rc = expand(pool, "galileo16.pcm", "temp1.pcm", 20, 0, 0); + rc = compress(pool, "temp1.pcm", "output.pcm", 1); + + for (i=0; i<2; ++i) { + rc = expand(pool, "output.pcm", "temp1.pcm", 20, 0, 0); + rc = compress(pool, "temp1.pcm", "output.pcm", 1); + } if (rc != 0) { puts("Error"); |