- Timestamp:
- Dec 20, 2018, 5:21:19 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
- Children:
- 14a5b9a
- Parents:
- b2e1740
- Location:
- src/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/ioutils.c
rb2e1740 r85e20fa 54 54 55 55 uint_t 56 aubio_source_validate_input_length(const char_t *kind, const char_t *path, 57 uint_t hop_size, uint_t read_data_length) 58 { 59 uint_t length = hop_size; 60 if (hop_size < read_data_length) { 61 AUBIO_WRN("%s: partial read from %s, trying to read %d frames, but" 62 " hop_size is %d\n", kind, path, read_data_length, hop_size); 63 } else if (hop_size > read_data_length) { 64 AUBIO_WRN("%s: partial read from %s, trying to read %d frames into" 65 " a buffer of length %d\n", kind, path, hop_size, read_data_length); 66 length = read_data_length; 67 } 68 return length; 69 } 70 71 uint_t 72 aubio_source_validate_input_channels(const char_t *kind, const char_t *path, 73 uint_t source_channels, uint_t read_data_height) 74 { 75 uint_t channels = source_channels; 76 if (read_data_height < source_channels) { 77 AUBIO_WRN("%s: partial read from %s, trying to read %d channels," 78 " but found output of height %d\n", kind, path, source_channels, 79 read_data_height); 80 channels = read_data_height; 81 } else if (read_data_height > source_channels) { 82 // do not show a warning when trying to read into more channels than 83 // the input source. 84 #if 0 85 AUBIO_WRN("%s: partial read from %s, trying to read %d channels," 86 " but found output of height %d\n", kind, path, source_channels, 87 read_data_height); 88 #endif 89 channels = source_channels; 90 } 91 return channels; 92 } 93 94 uint_t 56 95 aubio_sink_validate_input_length(const char_t *kind, const char_t *path, 57 96 uint_t max_size, uint_t write_data_length, uint_t write) -
src/io/ioutils.h
rb2e1740 r85e20fa 54 54 uint_t channels); 55 55 56 /** validate length of input 56 /** validate length of source output 57 58 \param kind the object kind to report on 59 \param path the path to report on 60 \param hop_size number of frames to be read 61 \param read_data_length actual length of input 62 63 \return hop_size or the maximum number of frames that can be written 64 */ 65 uint_t 66 aubio_source_validate_input_length(const char_t *kind, const char_t *path, 67 uint_t hop_size, uint_t read_data_length); 68 69 /** validate height of source output 70 71 \param kind the object kind to report on 72 \param path the path to report on 73 \param source_channels maximum number of channels that can be written 74 \param read_data_height actual height of input 75 76 \return write_data_height or the maximum number of channels 77 */ 78 uint_t 79 aubio_source_validate_input_channels(const char_t *kind, const char_t *path, 80 uint_t source_channels, uint_t read_data_height); 81 82 /** validate length of sink input 57 83 58 84 \param kind the object kind to report on 59 85 \param path the path to report on 60 86 \param max_size maximum number of frames that can be written 61 \param write_data_length actual length of input vector/matrix87 \param write_data_length actual length of input 62 88 \param write number of samples asked 63 89 … … 68 94 uint_t max_size, uint_t write_data_length, uint_t write); 69 95 70 /** validate height of input96 /** validate height of sink input 71 97 72 98 \param kind the object kind to report on 73 99 \param path the path to report on 74 \param max_sizemaximum number of channels that can be written100 \param sink_channels maximum number of channels that can be written 75 101 \param write_data_height actual height of input matrix 76 102
Note: See TracChangeset
for help on using the changeset viewer.