- 1. 算法原理
2. 代码实现
- void dsound_chorus_processmix(dsound_chorus_t* chorus, dsound_real_t *in,
- dsound_real_t *left_out, dsound_real_t *right_out)
- {
- int sample_index;
- int i;
- dsound_real_t d_in, d_out;
-
- for (sample_index = 0; sample_index < FLUID_BUFSIZE; sample_index++) {
-
- d_in = in[sample_index];
- d_out = 0.0f;
-
- # if 0
-
- left_out[sample_index]=0;
- right_out[sample_index]=0;
- #endif
-
-
- chorus->chorusbuf[chorus->counter] = d_in;
-
- for (i = 0; i < chorus->number_blocks; i++) {
- int ii;
-
-
-
-
-
-
- int pos_subsamples = (INTERPOLATION_SUBSAMPLES * chorus->counter
- - chorus->lookup_tab[chorus->phase[i]]);
-
- int pos_samples = pos_subsamples/INTERPOLATION_SUBSAMPLES;
-
-
- pos_subsamples &= INTERPOLATION_SUBSAMPLES_ANDMASK;
-
- for (ii = 0; ii < INTERPOLATION_SAMPLES; ii++){
-
-
-
-
-
-
- d_out += chorus->chorusbuf[pos_samples & MAX_SAMPLES_ANDMASK]
- * chorus->sinc_table[ii][pos_subsamples];
-
- pos_samples--;
- };
-
- chorus->phase[i]++;
- chorus->phase[i] %= (chorus->modulation_period_samples);
- }
-
- d_out *= chorus->level;
-
-
- left_out[sample_index] += d_out;
- right_out[sample_index] += d_out;
-
-
- chorus->counter++;
- chorus->counter %= MAX_SAMPLES;
-
- }
- }
合唱音效解释,布布扣,bubuko.com
合唱音效解释
原文:http://www.cnblogs.com/fuland/p/3787824.html