- Timestamp:
- Nov 16, 2018, 9:12:45 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- ac97e80d
- Parents:
- ca99325
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_avcodec.c
rca99325 r8a4ccf7 311 311 int err; 312 312 int64_t input_layout = av_get_default_channel_layout(s->input_channels); 313 uint_t output_channels = multi ? s->input_channels : 1; 314 int64_t output_layout = av_get_default_channel_layout(output_channels); 313 int64_t output_layout = av_get_default_channel_layout(s->input_channels); 315 314 #ifdef HAVE_AVRESAMPLE 316 315 AVAudioResampleContext *avr = avresample_alloc_context(); … … 504 503 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); 505 504 for (i = 0; i < end; i++) { 506 read_data->data[i + total_wrote] = s->output[i + s->read_index]; 505 read_data->data[i + total_wrote] = 0.; 506 for (j = 0; j < s->input_channels; j++) { 507 read_data->data[i + total_wrote] += 508 s->output[(i + s->read_index) * s->input_channels + j]; 509 } 510 read_data->data[i + total_wrote] *= 1./s->input_channels; 507 511 } 508 512 total_wrote += end;
Note: See TracChangeset
for help on using the changeset viewer.