Changeset 88042ef for src/synth/sampler.h
- Timestamp:
- Oct 4, 2016, 11:16:14 PM (8 years ago)
- Branches:
- sampler
- Children:
- 0a756ea
- Parents:
- 923670d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synth/sampler.h
r923670d r88042ef 24 24 /** \file 25 25 26 Load and play sound files.26 Load and play a sound file. 27 27 28 28 This file loads a sample and gets ready to play it. … … 30 30 The `_do` function adds the new samples to the input, and write the result as 31 31 the output. 32 33 TODO: 34 - add _preset_threaded(level) 35 - add _set_stretch 36 - add _set_pitch 32 37 33 38 \example synth/test-sampler.c … … 50 55 51 56 */ 52 aubio_sampler_t * new_aubio_sampler(uint_t samplerate, uint_t hop_size);57 aubio_sampler_t * new_aubio_sampler(uint_t hop_size, uint_t samplerate); 53 58 54 59 /** load source in sampler … … 62 67 uint_t aubio_sampler_load( aubio_sampler_t * o, const char_t * uri ); 63 68 69 /** queue source in sampler 70 71 \param o sampler, created by new_aubio_sampler() 72 \param uri the uri of the source to load 73 74 \return 0 if successfully queued, non-zero otherwise 75 76 */ 77 uint_t aubio_sampler_queue(aubio_sampler_t * o, const char_t * uri ); 78 64 79 /** process sampler function 65 80 66 81 \param o sampler, created by new_aubio_sampler() 67 \param input input of the sampler, to be added to the output68 82 \param output output of the sampler 69 83 70 This function adds the new samples from the playing source to the output. 71 72 If `input` is not NULL and different from `output`, then the samples from `input` 73 are added to the output. 74 75 */ 76 void aubio_sampler_do ( aubio_sampler_t * o, const fvec_t * input, fvec_t * output); 84 This function get new samples from the playing source into output. 85 86 */ 87 void aubio_sampler_do ( aubio_sampler_t * o, fvec_t * output, uint_t *read); 77 88 78 89 /** process sampler function, multiple channels 79 90 80 91 \param o sampler, created by new_aubio_sampler() 81 \param input input of the sampler, to be added to the output82 92 \param output output of the sampler 83 93 84 This function adds the new samples from the playing source to the output. 85 86 If `input` is not NULL and different from `output`, then the samples from `input` 87 are added to the output. 88 89 */ 90 void aubio_sampler_do_multi ( aubio_sampler_t * o, const fmat_t * input, fmat_t * output); 94 This function gets new samples from the playing source into output. 95 96 */ 97 void aubio_sampler_do_multi ( aubio_sampler_t * o, fmat_t * output, uint_t *read); 91 98 92 99 /** get current playing state … … 109 116 uint_t aubio_sampler_set_playing ( aubio_sampler_t * o, uint_t playing ); 110 117 118 uint_t aubio_sampler_get_loop(aubio_sampler_t * o); 119 120 /** set current looping state 121 122 \param o sampler, created by new_aubio_sampler() 123 \param looping 0 for not looping, 1 for looping 124 125 \return 0 if successful, 1 otherwise 126 127 */ 128 uint_t aubio_sampler_set_loop(aubio_sampler_t * o, uint_t loop); 129 111 130 /** play sample from start 112 131 … … 118 137 uint_t aubio_sampler_play ( aubio_sampler_t * o ); 119 138 139 /** play sample from start, looping it 140 141 \param o sampler, created by new_aubio_sampler() 142 143 \return 0 if successful, 1 otherwise 144 145 */ 146 uint_t aubio_sampler_loop ( aubio_sampler_t * o ); 147 148 /** play sample from start, once 149 150 \param o sampler, created by new_aubio_sampler() 151 152 \return 0 if successful, 1 otherwise 153 154 */ 155 uint_t aubio_sampler_trigger ( aubio_sampler_t * o ); 156 120 157 /** stop sample 121 158 … … 126 163 */ 127 164 uint_t aubio_sampler_stop ( aubio_sampler_t * o ); 165 166 /** get end-of-file status 167 168 \param o sampler, created by new_aubio_sampler() 169 170 \return 1 when the eof is being reached, 0 otherwise 171 172 */ 173 uint_t aubio_sampler_get_eof(aubio_sampler_t * o); 174 175 /** get end-of-file status 176 177 \param o sampler, created by new_aubio_sampler() 178 179 \return 1 when the eof is being reached, 0 otherwise 180 181 */ 182 uint_t aubio_sampler_get_finished (aubio_sampler_t * o); 183 184 /** get samplerate 185 186 \param o sampler, created by new_aubio_sampler() 187 188 \return samplerate of the sampler 189 190 */ 191 uint_t aubio_sampler_get_samplerate(aubio_sampler_t * o); 192 193 /** get the number of samples that were set to zero while opening a file 194 195 \param o sampler, created by new_aubio_sampler() 196 197 \return samplerate of the sampler 198 199 */ 200 uint_t aubio_sampler_get_waited_opening(aubio_sampler_t * o, uint_t waited); 201 202 /** seek to position 203 204 \param o sampler, created by new_aubio_sampler() 205 \param pos position to seek to, in samples 206 207 \return 0 if successful, 1 otherwise 208 209 */ 210 uint_t aubio_sampler_seek(aubio_sampler_t * o, uint_t pos); 128 211 129 212 /** destroy ::aubio_sampler_t object
Note: See TracChangeset
for help on using the changeset viewer.