}
s->hop_size = hop_size;
- s->samplerate = samplerate;
s->channels = 1;
s->path = path;
s->input_channels = sfinfo.channels;
s->input_format = sfinfo.format;
+ if (samplerate == 0) {
+ samplerate = s->input_samplerate;
+ AUBIO_WRN("sampling rate set to 0, automagically adjusting to %d", samplerate);
+ }
+ s->samplerate = samplerate;
/* compute input block size required before resampling */
s->ratio = s->samplerate/(float)s->input_samplerate;
s->input_hop_size = (uint_t)FLOOR(s->hop_size / s->ratio + .5);