[BACK]Return to dsp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/dsp.c between version 1.4 and 1.5

version 1.4, 2014/02/08 15:16:17 version 1.5, 2014/03/05 20:06:05
Line 685 
Line 685 
         }          }
 #endif  #endif
 }  }
   
 /*  
  * produce a square tone, for instance with:  
  *  
  *      period = round / (220 * round / rate)  
  */  
 int  
 sqrtone(int ctx, adata_t *out, int period, int vol, int todo)  
 {  
         int i;  
   
         for (i = todo; i > 0; i--) {  
                 if (ctx == 0) {  
                         vol = -vol;  
                         ctx = period / 2;  
                 }  
                 ctx--;  
                 *(out++) += vol;  
         }  
         return ctx;  
 }  

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5