Lines Matching refs:echos
67 priv_t * echos = (priv_t *) effp->priv; in sox_echos_getopts() local
70 echos->num_delays = 0; in sox_echos_getopts()
77 sscanf(argv[i++], "%f", &echos->in_gain); in sox_echos_getopts()
78 sscanf(argv[i++], "%f", &echos->out_gain); in sox_echos_getopts()
81 sscanf(argv[i++], "%f", &echos->delay[echos->num_delays]); in sox_echos_getopts()
82 sscanf(argv[i++], "%f", &echos->decay[echos->num_delays]); in sox_echos_getopts()
83 echos->num_delays++; in sox_echos_getopts()
84 if ( echos->num_delays > MAX_ECHOS ) in sox_echos_getopts()
91 echos->sumsamples = 0; in sox_echos_getopts()
100 priv_t * echos = (priv_t *) effp->priv; in sox_echos_start() local
105 if ( echos->in_gain < 0.0 ) in sox_echos_start()
110 if ( echos->in_gain > 1.0 ) in sox_echos_start()
115 if ( echos->out_gain < 0.0 ) in sox_echos_start()
120 for ( i = 0; i < echos->num_delays; i++ ) { in sox_echos_start()
121 echos->samples[i] = echos->delay[i] * effp->in_signal.rate / 1000.0; in sox_echos_start()
122 if ( echos->samples[i] < 1 ) in sox_echos_start()
127 if ( echos->samples[i] > (ptrdiff_t)DELAY_BUFSIZ ) in sox_echos_start()
133 if ( echos->decay[i] < 0.0 ) in sox_echos_start()
138 if ( echos->decay[i] > 1.0 ) in sox_echos_start()
143 echos->counter[i] = 0; in sox_echos_start()
144 echos->pointer[i] = echos->sumsamples; in sox_echos_start()
145 echos->sumsamples += echos->samples[i]; in sox_echos_start()
147 echos->delay_buf = lsx_malloc(sizeof (double) * echos->sumsamples); in sox_echos_start()
148 for ( j = 0; j < echos->sumsamples; ++j ) in sox_echos_start()
149 echos->delay_buf[j] = 0.0; in sox_echos_start()
152 for ( i = 0; i < echos->num_delays; i++ ) in sox_echos_start()
153 sum_in_volume += echos->decay[i]; in sox_echos_start()
154 if ( sum_in_volume * echos->in_gain > 1.0 / echos->out_gain ) in sox_echos_start()
169 priv_t * echos = (priv_t *) effp->priv; in sox_echos_flow() local
180 d_out = d_in * echos->in_gain; in sox_echos_flow()
181 for ( j = 0; j < echos->num_delays; j++ ) { in sox_echos_flow()
182 … d_out += echos->delay_buf[echos->counter[j] + echos->pointer[j]] * echos->decay[j]; in sox_echos_flow()
185 d_out = d_out * echos->out_gain; in sox_echos_flow()
189 for ( j = 0; j < echos->num_delays; j++ ) { in sox_echos_flow()
191 echos->delay_buf[echos->counter[j] + echos->pointer[j]] = d_in; in sox_echos_flow()
193 echos->delay_buf[echos->counter[j] + echos->pointer[j]] = in sox_echos_flow()
194 … echos->delay_buf[echos->counter[j-1] + echos->pointer[j-1]] + d_in; in sox_echos_flow()
197 for ( j = 0; j < echos->num_delays; j++ ) in sox_echos_flow()
198 echos->counter[j] = in sox_echos_flow()
199 ( echos->counter[j] + 1 ) % echos->samples[j]; in sox_echos_flow()
210 priv_t * echos = (priv_t *) effp->priv; in sox_echos_drain() local
218 while ( ( done < *osamp ) && ( done < echos->sumsamples ) ) { in sox_echos_drain()
221 for ( j = 0; j < echos->num_delays; j++ ) { in sox_echos_drain()
222 … d_out += echos->delay_buf[echos->counter[j] + echos->pointer[j]] * echos->decay[j]; in sox_echos_drain()
225 d_out = d_out * echos->out_gain; in sox_echos_drain()
229 for ( j = 0; j < echos->num_delays; j++ ) { in sox_echos_drain()
231 echos->delay_buf[echos->counter[j] + echos->pointer[j]] = d_in; in sox_echos_drain()
233 echos->delay_buf[echos->counter[j] + echos->pointer[j]] = in sox_echos_drain()
234 echos->delay_buf[echos->counter[j-1] + echos->pointer[j-1]]; in sox_echos_drain()
237 for ( j = 0; j < echos->num_delays; j++ ) in sox_echos_drain()
238 echos->counter[j] = in sox_echos_drain()
239 ( echos->counter[j] + 1 ) % echos->samples[j]; in sox_echos_drain()
241 echos->sumsamples--; in sox_echos_drain()
245 if (echos->sumsamples == 0) in sox_echos_drain()
256 priv_t * echos = (priv_t *) effp->priv; in sox_echos_stop() local
258 free(echos->delay_buf); in sox_echos_stop()
259 echos->delay_buf = NULL; in sox_echos_stop()