Changeset c8f411b


Ignore:
Timestamp:
Feb 10, 2013, 6:30:31 AM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
4db8eab
Parents:
a8752a8
Message:

src/io/source_sndfile.c: automagically set samplerate to input file if 0 is requested

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_sndfile.c

    ra8752a8 rc8f411b  
    7070
    7171  s->hop_size = hop_size;
    72   s->samplerate = samplerate;
    7372  s->channels = 1;
    7473  s->path = path;
     
    9089  s->input_format     = sfinfo.format;
    9190
     91  if (samplerate == 0) {
     92    samplerate = s->input_samplerate;
     93    AUBIO_WRN("sampling rate set to 0, automagically adjusting to %d", samplerate);
     94  }
     95  s->samplerate = samplerate;
    9296  /* compute input block size required before resampling */
    9397  s->ratio = s->samplerate/(float)s->input_samplerate;
Note: See TracChangeset for help on using the changeset viewer.