Example #1
0
static void
_bmlw_work_m2s (BmlIpcBuf * bi, BmlIpcBuf * bo)
{
  BuzzMachine *bm = (BuzzMachine *) bmlipc_read_int (bi);
  int size = bmlipc_read_int (bi);
  float *pin = (float *) bmlipc_read_data (bi, size);
  int mode = bmlipc_read_int (bi);
  float pout[256 + 256] = { 0.0, };     // MAX_BUFFER_LENGTH = 256
  int numsamples = size / sizeof (float);
  int ret = bmlw_work_m2s (bm, pin, pout, numsamples, mode);
  size += size;
  // DEBUG
#if 0
  {
    FILE *df;
    if ((df = fopen ("/tmp/bmlout_s.raw", "ab"))) {
      fwrite (pout, size, 1, df);
      fclose (df);
    }
  }
#endif
  // DEBUG
  TRACE ("processed size=%d/numsamples=%d, in mode=%d\n", size, numsamples,
      mode);
  bmlipc_write_int (bo, ret);
  bmlipc_write_int (bo, size);
  bmlipc_write_data (bo, size, (char *) pout);
}
Example #2
0
int
bmlw_work_m2s (BuzzMachine * bm, float *pin, float *pout, int numsamples,
    int const mode)
{
  int ret;

  win32_prolog ();
  ret = BMLX (bmlw_work_m2s (bm, pin, pout, numsamples, mode));
  win32_eliplog ();
  return ret;
}