summaryrefslogtreecommitdiff
path: root/src/crosscomposer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/crosscomposer.cc')
-rw-r--r--src/crosscomposer.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/crosscomposer.cc b/src/crosscomposer.cc
index 010aa92..169fd4c 100644
--- a/src/crosscomposer.cc
+++ b/src/crosscomposer.cc
@@ -32,13 +32,19 @@
#include "audioin.h"
#include "audioout.h"
+#include "audio.h"
+
#define NUM_SAMPLES 940
int main(int argc, char *argv[])
{
- sample_t samples[940];
+ sample_t samples[NUM_SAMPLES];
Socket s;
s.open("127.0.0.1", 10000);
+ int loop = 100;
+
+ return pamain();
+
switch(fork()) {
case 0:
@@ -46,11 +52,11 @@ int main(int argc, char *argv[])
AudioIn in("default", "Capture", 44100, 1);
s.setSend(0);
- int i = 50;
- while(i--) {
+ while(loop--) {
int sz = in.read(samples, NUM_SAMPLES);
for(size_t i = 0; i < NUM_SAMPLES; i++) {
- samples[i] = ((sample_t)rand() / (float)RAND_MAX) * 10;
+ //samples[i] = ((sample_t)rand() / (float)RAND_MAX) * 10;
+ //samples[i] *= 30;
}
s.sendTo(samples, sz * sizeof(sample_t));
printf("s"); fflush(stdout);
@@ -64,10 +70,10 @@ int main(int argc, char *argv[])
s.setRecv();
AudioOut out("default", 44100, 1);
- int i = 50;
- while(i--) {
+ while(loop--) {
int sz = s.recvFrom(samples, sizeof(samples));
out.write(samples, sz / sizeof(sample_t));
+ sz = sz;
printf("r%f", samples[0]); fflush(stdout);
}
printf("R!\n");