- Timestamp:
- Mar 3, 2013, 4:50:04 AM (12 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- a64ef1d
- Parents:
- 9e56228
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r9e56228 r33cd81f 44 44 45 45 fvec_t * 46 new_aubio_window (char_t * window_type, uint_t size) 47 { 48 fvec_t * win = new_fvec (size); 46 new_aubio_window (char_t * window_type, uint_t length) 47 { 48 fvec_t * win = new_fvec (length); 49 fvec_set_window (win, window_type); 50 return win; 51 } 52 53 uint_t fvec_set_window (fvec_t *win, char_t *window_type) { 49 54 smpl_t * w = win->data; 50 uint_t i ;55 uint_t i, size = win->length; 51 56 aubio_window_type wintype; 52 if (strcmp (window_type, "rectangle") == 0) 57 if (window_type == NULL) { 58 AUBIO_ERR ("window type can not be null.\n"); 59 return 1; 60 } else if (strcmp (window_type, "rectangle") == 0) 53 61 wintype = aubio_win_rectangle; 54 62 else if (strcmp (window_type, "hamming") == 0) … … 71 79 wintype = aubio_win_default; 72 80 else { 73 AUBIO_ERR ("unknown window type %s, using default.\n", window_type);74 wintype = aubio_win_default;81 AUBIO_ERR ("unknown window type `%s`.\n", window_type); 82 return 1; 75 83 } 76 84 switch(wintype) { … … 127 135 break; 128 136 } 129 return win;137 return 0; 130 138 } 131 139 -
src/musicutils.h
r9e56228 r33cd81f 45 45 */ 46 46 fvec_t *new_aubio_window (char_t * window_type, uint_t size); 47 48 /** set elements of a vector to window coefficients 49 50 */ 51 uint_t fvec_set_window (fvec_t * window, char_t * window_type); 47 52 48 53 /** compute the principal argument
Note: See TracChangeset
for help on using the changeset viewer.