Changeset d69e37d


Ignore:
Timestamp:
Sep 25, 2009, 3:54:05 AM (15 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:
194ef6b
Parents:
bd54912
Message:

ext/sndfileio.c: convert data from and to float if smpl_t != float

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ext/sndfileio.c

    rbd54912 rd69e37d  
    129129        int nsamples = frames*channels;
    130130        int aread;
    131         float *pread;   
     131        smpl_t *pread; 
    132132
    133133        /* allocate data for de/interleaving reallocated when needed. */
     
    149149        /* de-interleaving data  */
    150150        for (i=0; i<channels; i++) {
    151                 pread = (float *)fvec_get_channel(read,i);
     151                pread = (smpl_t *)fvec_get_channel(read,i);
    152152                for (j=0; j<aread; j++) {
    153                         pread[j] = f->tmpdata[channels*j+i];
     153                        pread[j] = (smpl_t)f->tmpdata[channels*j+i];
    154154                }
    155155        }
     
    164164        int i, j,       channels = f->channels;
    165165        int nsamples = channels*frames;
    166         float *pwrite;
     166        smpl_t *pwrite;
    167167
    168168        /* allocate data for de/interleaving reallocated when needed. */
     
    179179        /* interleaving data  */
    180180        for (i=0; i<channels; i++) {
    181                 pwrite = (float *)fvec_get_channel(write,i);
     181                pwrite = (smpl_t *)fvec_get_channel(write,i);
    182182                for (j=0; j<frames; j++) {
    183                         f->tmpdata[channels*j+i] = pwrite[j];
     183                        f->tmpdata[channels*j+i] = (float)pwrite[j];
    184184                }
    185185        }
Note: See TracChangeset for help on using the changeset viewer.