// Convert list of angle-angle-lingertime triples to series of WAV file blobs
 private void triplesToBlobs(List <angleTimeTriplet> triples, int angle0Microseconds, int angle180Microseconds, out List <WAVblob> blobList)
 {
     blobList = new List <WAVblob>();
     foreach (angleTimeTriplet t in triples)
     {
         for (int i = t.linger; i > 0; i -= (int)blobLengthMillis)
         {
             WAVblob b = new WAVblob();
             b.left  = (UInt32)(angle0Microseconds + (t.arm1angle / Math.PI) * (angle180Microseconds - angle0Microseconds));
             b.right = (UInt32)(angle0Microseconds + (t.arm2angle / Math.PI) * (angle180Microseconds - angle0Microseconds));
             blobList.Add(b);
         }
     }
 }
Ejemplo n.º 2
0
 // Convert list of angle-angle-lingertime triples to series of WAV file blobs
 private void triplesToBlobs(List<angleTimeTriplet> triples, int angle0Microseconds, int angle180Microseconds, out List<WAVblob> blobList)
 {
    blobList = new List<WAVblob>();
    foreach (angleTimeTriplet t in triples)
    {
       for (int i = t.linger; i > 0; i -= (int)blobLengthMillis)
       {
          WAVblob b = new WAVblob();
          b.left = (UInt32)(angle0Microseconds + (t.arm1angle / Math.PI) * (angle180Microseconds - angle0Microseconds));
          b.right = (UInt32)(angle0Microseconds + (t.arm2angle / Math.PI) * (angle180Microseconds - angle0Microseconds));
          blobList.Add(b);
       }
    }
 }