Changeset cf19b8a for src/io/sink_sndfile.c
- Timestamp:
- Nov 29, 2016, 12:06:21 PM (7 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, sampler, yinfft+
- Children:
- bb96d02
- Parents:
- c8e08c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_sndfile.c
rc8e08c2 rcf19b8a 30 30 #include "fmat.h" 31 31 #include "io/sink_sndfile.h" 32 #include "io/ioutils.h" 32 33 33 34 #define MAX_CHANNELS 6 … … 70 71 s->channels = 0; 71 72 72 // negative samplerate given, abort73 if ((sint_t)samplerate < 0) goto beach;74 73 // zero samplerate given. do not open yet 75 if ((sint_t)samplerate == 0) return s; 74 if ((sint_t)samplerate == 0) { 75 return s; 76 } 77 // invalid samplerate given, abort 78 if (aubio_io_validate_samplerate("sink_sndfile", s->path, samplerate)) { 79 goto beach; 80 } 76 81 77 82 s->samplerate = samplerate; … … 90 95 uint_t aubio_sink_sndfile_preset_samplerate(aubio_sink_sndfile_t *s, uint_t samplerate) 91 96 { 92 if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL; 97 if (aubio_io_validate_samplerate("sink_sndfile", s->path, samplerate)) { 98 return AUBIO_FAIL; 99 } 93 100 s->samplerate = samplerate; 94 101 // automatically open when both samplerate and channels have been set … … 101 108 uint_t aubio_sink_sndfile_preset_channels(aubio_sink_sndfile_t *s, uint_t channels) 102 109 { 103 if ((sint_t)(channels) <= 0) return AUBIO_FAIL; 110 if (aubio_io_validate_channels("sink_sndfile", s->path, channels)) { 111 return AUBIO_FAIL; 112 } 104 113 s->channels = channels; 105 114 // automatically open when both samplerate and channels have been set
Note: See TracChangeset
for help on using the changeset viewer.