Ignore:
Timestamp:
Mar 23, 2013, 1:55:46 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
c059581, c833f56
Parents:
f174a22
Message:

src/io/source_apple_audio.c: copy data to missing channels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_apple_audio.c

    rf174a22 rb8389de  
    205205    }
    206206  }
     207  // if read_data has more channels than the file
     208  if (read_to->height > s->channels) {
     209    // copy last channel to all additional channels
     210    for (v = 0; v < loadedPackets; v++) {
     211      for (c = s->channels; c < read_to->height; c++) {
     212        buf[c][v] = SHORT_TO_FLOAT(data[ v * s->channels + (s->channels - 1)]);
     213      }
     214    }
     215  }
    207216  // short read, fill with zeros
    208217  if (loadedPackets < s->block_size) {
    209218    for (v = loadedPackets; v < s->block_size; v++) {
    210       for (c = 0; c < s->channels; c++) {
     219      for (c = 0; c < read_to->height; c++) {
    211220        buf[c][v] = 0.;
    212221      }
Note: See TracChangeset for help on using the changeset viewer.