Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common/Util
diff options
context:
space:
mode:
authorNat <natcl@hotmail.com>2007-11-08 17:42:19 (GMT)
committer Nat <natcl@hotmail.com>2007-11-08 17:42:19 (GMT)
commit0b56a247f1cc4e40523d443f52eb0a224a492bea (patch)
treee9e97fd85d05ff17706ce8b6d3b49b5b71a89c7c /common/Util
parent6b5c9dad4edcee567abb83ef98593a54c82a4633 (diff)
aclient fix by James
Diffstat (limited to 'common/Util')
-rw-r--r--common/Util/Clooper/aclient.cpp19
-rwxr-xr-xcommon/Util/Clooper/aclient.sobin59030 -> 57129 bytes
-rw-r--r--common/Util/Clooper/audio.cpp12
3 files changed, 24 insertions, 7 deletions
diff --git a/common/Util/Clooper/aclient.cpp b/common/Util/Clooper/aclient.cpp
index 1146c3b..02b4f6c 100644
--- a/common/Util/Clooper/aclient.cpp
+++ b/common/Util/Clooper/aclient.cpp
@@ -550,7 +550,7 @@ struct TamTamSound
int argc=3;
char **argv = (char**)malloc(argc*sizeof(char*));
argv[0] = "csound";
- argv[1] = "-m0";
+ argv[1] = "-m7";
argv[2] = orc;
ll->printf(1, "loading csound orchestra file %s\n", orc);
@@ -625,18 +625,29 @@ struct TamTamSound
cbuf_pos = 0;
if (csoundPerformBuffer(csound)) { messed = 1;break;}
cbuf = csoundGetOutputBuffer(csound);
+ cursample[0] = (signed short int) (cbuf[cbuf_pos*2+0] * (1<<15));
+ cursample[1] = (signed short int) (cbuf[cbuf_pos*2+1] * (1<<15));
+
+/*
+ cbuf[cbuf_pos*2+0] *= (float) ((1<<14));
+ cbuf[cbuf_pos*2+1] *= (float) ((1<<14));
+ FLOAT_TO_SHORT( cbuf[cbuf_pos*2+0], cursample[0]);
+ FLOAT_TO_SHORT( cbuf[cbuf_pos*2+1], cursample[1]);
+*/
}
upbuf[2*up_pos+0] = cursample[0];
upbuf[2*up_pos+1] = cursample[1];
-
if (++ratio_pos == up_ratio)
{
ratio_pos = 0;
++cbuf_pos;
- cbuf[cbuf_pos*2+0] *= (float) ((1<<15)-100.0f);
- cbuf[cbuf_pos*2+1] *= (float) ((1<<15)-100.0f);
+ cursample[0] = (signed short int) (cbuf[cbuf_pos*2+0] * (1<<15));
+ cursample[1] = (signed short int) (cbuf[cbuf_pos*2+1] * (1<<15));
+ /*cbuf[cbuf_pos*2+0] *= (float) ((1<<14));
+ cbuf[cbuf_pos*2+1] *= (float) ((1<<14));
FLOAT_TO_SHORT( cbuf[cbuf_pos*2+0], cursample[0]);
FLOAT_TO_SHORT( cbuf[cbuf_pos*2+1], cursample[1]);
+*/
}
if (++up_pos == (signed)sys_stuff->period_size) break;
diff --git a/common/Util/Clooper/aclient.so b/common/Util/Clooper/aclient.so
index 996e9e3..ca76f30 100755
--- a/common/Util/Clooper/aclient.so
+++ b/common/Util/Clooper/aclient.so
Binary files differ
diff --git a/common/Util/Clooper/audio.cpp b/common/Util/Clooper/audio.cpp
index 343bc99..fea9c73 100644
--- a/common/Util/Clooper/audio.cpp
+++ b/common/Util/Clooper/audio.cpp
@@ -119,8 +119,10 @@ struct SystemStuff
snd_pcm_hw_params_get_period_size_max(hw, &maxb,&maxd);
ll->printf(2, "FYI: period size range is [%li/%i,%li/%i]\n", minb,mind, maxb, maxd);
- assert(mind == 0); //rate_resample 0 makes this true right?
- assert(maxd == 0); //rate_resample 0 makes this true right?
+ if ((mind != 0) || (maxd == 0))
+ {
+ ll->printf(2, "watch out, mind and maxd non-zero... you didn't set rate_resample to 0 did you...\n");
+ }
if (period0 < minb)
{
@@ -196,7 +198,11 @@ open_error:
err = snd_pcm_writei (phandle, frame_data, frame_count );
if (err == (signed)frame_count) return 0; //success
- assert(err < 0);
+ if (err >= 0)
+ {
+ ll->printf(0, "madness on line %s:%i\n", __FILE__, __LINE__);
+ return -1;
+ }
const char * msg = NULL;
snd_pcm_state_t state = snd_pcm_state(phandle);