Changeset 5550:61fb37b34dc4 in roaraudio
- Timestamp:
- 06/17/12 23:40:38 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarsin.c
r5549 r5550 83 83 " --freq FREQ - Set frequency (in Hz)\n" 84 84 " --time TIME - Set time (in sec)\n" 85 " --volume VOL - Set volume\n" 85 86 ); 86 87 … … 108 109 int16_t out[1024]; 109 110 double (*func)(double x) = sin; 111 double volume = 1; 110 112 111 113 for (i = 1; i < argc; i++) { … … 118 120 } else if ( !strcmp(argv[i], "--rate") || !strcmp(argv[i], "-R") ) { 119 121 rate = roar_str2rate(argv[++i]); 122 } else if ( !strcmp(argv[i], "--volume") ) { 123 volume = atof(argv[++i]); 120 124 } else if ( !strcmp(argv[i], "--sin") ) { 121 125 func = sin; … … 144 148 } 145 149 150 if ( roar_vs_volume_mono(vss, volume, NULL) == 0 ) { 151 // If setting server volume successed set local volume to one. 152 volume = 1; 153 } 154 146 155 while (t < 2*M_PI*freq*length) { 147 156 for (i = 0; i < 1024; i++) { 148 out[i] = 32767 *func(tcalc);157 out[i] = 32767.*volume*func(tcalc); 149 158 t += step; 150 159 tcalc += step;
Note: See TracChangeset
for help on using the changeset viewer.