Changeset cf19b8a
- Timestamp:
- Nov 29, 2016, 12:06:21 PM (8 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
- Location:
- src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/aubio_priv.h
rc8e08c2 rcf19b8a 197 197 #define AUBIO_SPRINTF sprintf 198 198 199 #define AUBIO_MAX_SAMPLERATE (192000*8) 200 #define AUBIO_MAX_CHANNELS 1024 201 199 202 /* pi and 2*pi */ 200 203 #ifndef M_PI -
src/io/sink_apple_audio.c
rc8e08c2 rcf19b8a 27 27 #include "fmat.h" 28 28 #include "io/sink_apple_audio.h" 29 #include "io/ioutils.h" 29 30 30 31 // CFURLRef, CFURLCreateWithFileSystemPath, ... … … 74 75 s->channels = 0; 75 76 76 // negative samplerate given, abort77 if ((sint_t)samplerate < 0) goto beach;78 77 // zero samplerate given. do not open yet 79 if ((sint_t)samplerate == 0) return s; 78 if ((sint_t)samplerate == 0) { 79 return s; 80 } 81 // invalid samplerate given, abort 82 if (aubio_io_validate_samplerate("sink_apple_audio", s->path, samplerate)) { 83 goto beach; 84 } 80 85 81 86 s->samplerate = samplerate; … … 95 100 uint_t aubio_sink_apple_audio_preset_samplerate(aubio_sink_apple_audio_t *s, uint_t samplerate) 96 101 { 97 if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL; 102 if (aubio_io_validate_samplerate("sink_apple_audio", s->path, samplerate)) { 103 return AUBIO_FAIL; 104 } 98 105 s->samplerate = samplerate; 99 106 // automatically open when both samplerate and channels have been set … … 106 113 uint_t aubio_sink_apple_audio_preset_channels(aubio_sink_apple_audio_t *s, uint_t channels) 107 114 { 108 if ((sint_t)(channels) <= 0) return AUBIO_FAIL; 115 if (aubio_io_validate_channels("sink_apple_audio", s->path, channels)) { 116 return AUBIO_FAIL; 117 } 109 118 s->channels = channels; 110 119 // automatically open when both samplerate and channels have been set -
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 -
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.