Mercurial > pygar
diff modules/bluespec/Pygar/core/AudioCoreSystem.cpp @ 36:99519a031813 pygar svn.37
[svn r37] moved the server into audioCorePipeline
author | punk |
---|---|
date | Tue, 04 May 2010 18:54:54 -0400 |
parents | 1a21b4cd85ee |
children | 0475235d1513 |
line wrap: on
line diff
1.1 --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Tue May 04 12:14:24 2010 -0400 1.2 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Tue May 04 18:54:54 2010 -0400 1.3 @@ -64,13 +64,13 @@ 1.4 { 1.5 //rlm: two files 1.6 FILE *inputFile; 1.7 - FILE *inputFile1; 1.8 + // FILE *inputFile1; 1.9 UINT16 sample; 1.10 - UINT16 sample1; 1.11 + //UINT16 sample1; 1.12 1.13 //rlm: not sure if normal ints are ok here; using UINT16 because I know it works 1.14 UINT16 channel0 = 0; 1.15 - UINT16 channel1 = 1; 1.16 + //UINT16 channel1 = 1; 1.17 1.18 //init processor 1.19 int sleepCount = 0; 1.20 @@ -78,8 +78,6 @@ 1.21 1.22 bool coreFin = false; 1.23 1.24 - 1.25 - 1.26 fflush(stdout); 1.27 1.28 // Convert input wav to pcm 1.29 @@ -88,16 +86,15 @@ 1.30 //rlm: for now we are going to going to just have 2 files with "common names" 1.31 1.32 generate_pcm("input.wav","input.pcm"); 1.33 - generate_pcm("input1.wav", "input1.pcm"); 1.34 - 1.35 + //generate_pcm("input1.wav", "input1.pcm"); 1.36 1.37 1.38 //Send data to the machine here. 1.39 //rlm: two files 1.40 inputFile = fopen("input.pcm","r"); 1.41 - inputFile = fopen("input1.pcm", "r"); 1.42 + // inputFile = fopen("input1.pcm", "r"); 1.43 1.44 - assert(inputFile1); 1.45 + //assert(inputFile1); 1.46 assert(inputFile); 1.47 1.48 int count = 0; 1.49 @@ -106,7 +103,8 @@ 1.50 1.51 //rlm: here we read both files. later refactor into a function. 1.52 // also, this will terminate when the FIRST file reaches its end. 1.53 - while( (fread(&sample, 2, 1, inputFile)) && (fread(&sample1, 2 , 1, inputFile1))) { 1.54 + while( (fread(&sample, 2, 1, inputFile)) )//&& (fread(&sample1, 2 , 1, inputFile1))) 1.55 + { 1.56 if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) 1.57 { 1.58 sleepCount++; 1.59 @@ -131,8 +129,9 @@ 1.60 sem_wait(&throttle); 1.61 1.62 //rlm: two files. 1.63 - clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample); 1.64 - clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1); 1.65 + clientStub->SendUnprocessedStream( Data,(UINT32)sample); 1.66 + //clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample); 1.67 + //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1); 1.68 1.69 } 1.70 1.71 @@ -143,8 +142,9 @@ 1.72 1.73 //rlm: have to send end-files to both voices. 1.74 // all of these operations wil eventually be moved into functions. 1.75 - clientStub->SendUnprocessedStream(channel0, EndOfFile,0); 1.76 - clientStub->SendUnprocessedStream(channel1, EndOfFile,0); 1.77 + clientStub->SendUnprocessedStream(EndOfFile,0); 1.78 + //clientStub->SendUnprocessedStream(channel0, EndOfFile,0); 1.79 + // clientStub->SendUnprocessedStream(channel1, EndOfFile,0); 1.80 1.81 printf("main: wait for end of file\n"); 1.82