Changeset cf19b8a for src/io/sink_wavwrite.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_wavwrite.c
rc8e08c2 rcf19b8a 28 28 #include "fmat.h" 29 29 #include "io/sink_wavwrite.h" 30 #include "io/ioutils.h" 30 31 31 32 #include <errno.h> … … 105 106 s->channels = 0; 106 107 107 // negative samplerate given, abort108 if ((sint_t)samplerate < 0) goto beach;109 108 // zero samplerate given. do not open yet 110 if ((sint_t)samplerate == 0) return s; 111 // samplerate way too large, fail 112 if ((sint_t)samplerate > 192000 * 4) goto beach; 109 if ((sint_t)samplerate == 0) { 110 return s; 111 } 112 // invalid samplerate given, abort 113 if (aubio_io_validate_samplerate("sink_wavwrite", s->path, samplerate)) { 114 goto beach; 115 } 113 116 114 117 s->samplerate = samplerate; … … 130 133 uint_t aubio_sink_wavwrite_preset_samplerate(aubio_sink_wavwrite_t *s, uint_t samplerate) 131 134 { 132 if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL; 135 if (aubio_io_validate_samplerate("sink_wavwrite", s->path, samplerate)) { 136 return AUBIO_FAIL; 137 } 133 138 s->samplerate = samplerate; 134 139 // automatically open when both samplerate and channels have been set … … 141 146 uint_t aubio_sink_wavwrite_preset_channels(aubio_sink_wavwrite_t *s, uint_t channels) 142 147 { 143 if ((sint_t)(channels) <= 0) return AUBIO_FAIL; 148 if (aubio_io_validate_channels("sink_wavwrite", s->path, channels)) { 149 return AUBIO_FAIL; 150 } 144 151 s->channels = channels; 145 152 // automatically open when both samplerate and channels have been set
Note: See TracChangeset
for help on using the changeset viewer.