- Timestamp:
- Mar 12, 2017, 11:26:24 AM (8 years ago)
- Branches:
- sampler
- Children:
- bde49c4a
- Parents:
- 71f2e5f (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 added
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
src/aubio.h
r71f2e5f r41b985f 110 110 111 111 Several examples of C programs are available in the \p examples/ and \p tests/src 112 directories of the source tree. See more examples: 113 @ref spectral/test-fft.c 114 @ref spectral/test-phasevoc.c 115 @ref onset/test-onset.c 116 @ref pitch/test-pitch.c 117 @ref tempo/test-tempo.c 118 @ref test-fvec.c 119 @ref test-cvec.c 112 directories of the source tree. 113 114 Some examples: 115 - @ref spectral/test-fft.c 116 - @ref spectral/test-phasevoc.c 117 - @ref onset/test-onset.c 118 - @ref pitch/test-pitch.c 119 - @ref tempo/test-tempo.c 120 - @ref test-fvec.c 121 - @ref test-cvec.c 120 122 121 123 \subsection unstable_api Unstable API … … 138 140 139 141 Latest versions, further documentation, examples, wiki, and mailing lists can 140 be found at http ://aubio.org .142 be found at https://aubio.org . 141 143 142 144 */ -
src/aubio_priv.h
r71f2e5f r41b985f 34 34 */ 35 35 36 #ifdef HAVE_CONFIG_H 36 37 #include "config.h" 38 #endif 37 39 38 40 #ifdef HAVE_STDLIB_H … … 182 184 #ifdef HAVE_C99_VARARGS_MACROS 183 185 #define AUBIO_ERR(...) aubio_log(AUBIO_LOG_ERR, "AUBIO ERROR: " __VA_ARGS__) 186 #define AUBIO_INF(...) aubio_log(AUBIO_LOG_INF, "AUBIO INFO: " __VA_ARGS__) 184 187 #define AUBIO_MSG(...) aubio_log(AUBIO_LOG_MSG, __VA_ARGS__) 185 188 #define AUBIO_DBG(...) aubio_log(AUBIO_LOG_DBG, __VA_ARGS__) 186 189 #define AUBIO_WRN(...) aubio_log(AUBIO_LOG_WRN, "AUBIO WARNING: " __VA_ARGS__) 187 190 #else 188 #define AUBIO_ERR(format, args...) aubio_log(stderr, "AUBIO ERROR: " format , ##args) 189 #define AUBIO_MSG(format, args...) aubio_log(stdout, format , ##args) 190 #define AUBIO_DBG(format, args...) aubio_log(stderr, format , ##args) 191 #define AUBIO_WRN(format, args...) aubio_log(stderr, "AUBIO WARNING: " format, ##args) 191 #define AUBIO_ERR(format, args...) aubio_log(AUBIO_LOG_ERR, "AUBIO ERROR: " format , ##args) 192 #define AUBIO_INF(format, args...) aubio_log(AUBIO_LOG_INF, "AUBIO INFO: " format , ##args) 193 #define AUBIO_MSG(format, args...) aubio_log(AUBIO_LOG_MSG, format , ##args) 194 #define AUBIO_DBG(format, args...) aubio_log(AUBIO_LOG_DBG, format , ##args) 195 #define AUBIO_WRN(format, args...) aubio_log(AUBIO_LOG_WRN, "AUBIO WARNING: " format, ##args) 192 196 #endif 193 197 … … 196 200 #define AUBIO_QUIT(_s) exit(_s) 197 201 #define AUBIO_SPRINTF sprintf 202 203 #define AUBIO_MAX_SAMPLERATE (192000*8) 204 #define AUBIO_MAX_CHANNELS 1024 198 205 199 206 /* pi and 2*pi */ -
src/fmat.c
r71f2e5f r41b985f 111 111 uint_t i,j; 112 112 for (i=0; i< s->height; i++) { 113 for (j=0; j< FLOOR( s->length/2); j++) {113 for (j=0; j< FLOOR((smpl_t)s->length/2); j++) { 114 114 ELEM_SWAP(s->data[i][j], s->data[i][s->length-1-j]); 115 115 } -
src/fvec.c
r71f2e5f r41b985f 91 91 void fvec_rev(fvec_t *s) { 92 92 uint_t j; 93 for (j=0; j< FLOOR( s->length/2); j++) {93 for (j=0; j< FLOOR((smpl_t)s->length/2); j++) { 94 94 ELEM_SWAP(s->data[j], s->data[s->length-1-j]); 95 95 } -
src/io/audio_unit.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include " config.h"21 #include "aubio_priv.h" 22 22 #ifdef HAVE_AUDIO_UNIT 23 #include "aubio_priv.h"24 23 25 24 #include "fvec.h" -
src/io/sink.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include "config.h"22 21 #include "aubio_priv.h" 23 22 #include "fvec.h" … … 99 98 } 100 99 #endif /* HAVE_WAVWRITE */ 101 AUBIO_ERROR("sink: failed creating %s with samplerate %dHz\n", 102 uri, samplerate); 100 #if !defined(HAVE_WAVWRITE) && \ 101 !defined(HAVE_SNDFILE) && \ 102 !defined(HAVE_SINK_APPLE_AUDIO) 103 AUBIO_ERROR("sink: failed creating '%s' at %dHz (no sink built-in)\n", uri, samplerate); 104 #endif 103 105 AUBIO_FREE(s); 104 106 return NULL; -
src/io/sink_apple_audio.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include " config.h"21 #include "aubio_priv.h" 22 22 23 23 #ifdef HAVE_SINK_APPLE_AUDIO 24 25 #include "aubio_priv.h"26 24 #include "fvec.h" 27 25 #include "fmat.h" 28 26 #include "io/sink_apple_audio.h" 27 #include "io/ioutils.h" 29 28 30 29 // CFURLRef, CFURLCreateWithFileSystemPath, ... … … 63 62 s->async = false; 64 63 65 if ( uri == NULL) {64 if ( (uri == NULL) || (strlen(uri) < 1) ) { 66 65 AUBIO_ERROR("sink_apple_audio: Aborted opening null path\n"); 67 66 goto beach; … … 74 73 s->channels = 0; 75 74 76 // negative samplerate given, abort77 if ((sint_t)samplerate < 0) goto beach;78 75 // zero samplerate given. do not open yet 79 if ((sint_t)samplerate == 0) return s; 76 if ((sint_t)samplerate == 0) { 77 return s; 78 } 79 // invalid samplerate given, abort 80 if (aubio_io_validate_samplerate("sink_apple_audio", s->path, samplerate)) { 81 goto beach; 82 } 80 83 81 84 s->samplerate = samplerate; … … 95 98 uint_t aubio_sink_apple_audio_preset_samplerate(aubio_sink_apple_audio_t *s, uint_t samplerate) 96 99 { 97 if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL; 100 if (aubio_io_validate_samplerate("sink_apple_audio", s->path, samplerate)) { 101 return AUBIO_FAIL; 102 } 98 103 s->samplerate = samplerate; 99 104 // automatically open when both samplerate and channels have been set … … 106 111 uint_t aubio_sink_apple_audio_preset_channels(aubio_sink_apple_audio_t *s, uint_t channels) 107 112 { 108 if ((sint_t)(channels) <= 0) return AUBIO_FAIL; 113 if (aubio_io_validate_channels("sink_apple_audio", s->path, channels)) { 114 return AUBIO_FAIL; 115 } 109 116 s->channels = channels; 110 117 // automatically open when both samplerate and channels have been set -
src/io/sink_sndfile.c
r71f2e5f r41b985f 20 20 21 21 22 #include " config.h"22 #include "aubio_priv.h" 23 23 24 24 #ifdef HAVE_SNDFILE … … 26 26 #include <sndfile.h> 27 27 28 #include "aubio_priv.h"29 28 #include "fvec.h" 30 29 #include "fmat.h" 31 30 #include "io/sink_sndfile.h" 32 33 #define MAX_CHANNELS 6 31 #include "io/ioutils.h" 32 34 33 #define MAX_SIZE 4096 35 34 … … 70 69 s->channels = 0; 71 70 72 // negative samplerate given, abort73 if ((sint_t)samplerate < 0) goto beach;74 71 // zero samplerate given. do not open yet 75 if ((sint_t)samplerate == 0) return s; 72 if ((sint_t)samplerate == 0) { 73 return s; 74 } 75 // invalid samplerate given, abort 76 if (aubio_io_validate_samplerate("sink_sndfile", s->path, samplerate)) { 77 goto beach; 78 } 76 79 77 80 s->samplerate = samplerate; … … 90 93 uint_t aubio_sink_sndfile_preset_samplerate(aubio_sink_sndfile_t *s, uint_t samplerate) 91 94 { 92 if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL; 95 if (aubio_io_validate_samplerate("sink_sndfile", s->path, samplerate)) { 96 return AUBIO_FAIL; 97 } 93 98 s->samplerate = samplerate; 94 99 // automatically open when both samplerate and channels have been set … … 101 106 uint_t aubio_sink_sndfile_preset_channels(aubio_sink_sndfile_t *s, uint_t channels) 102 107 { 103 if ((sint_t)(channels) <= 0) return AUBIO_FAIL; 108 if (aubio_io_validate_channels("sink_sndfile", s->path, channels)) { 109 return AUBIO_FAIL; 110 } 104 111 s->channels = channels; 105 112 // automatically open when both samplerate and channels have been set … … 133 140 if (s->handle == NULL) { 134 141 /* show libsndfile err msg */ 135 AUBIO_ERR("sink_sndfile: Failed opening %s. %s\n", s->path, sf_strerror (NULL)); 142 AUBIO_ERR("sink_sndfile: Failed opening \"%s\" with %d channels, %dHz: %s\n", 143 s->path, s->channels, s->samplerate, sf_strerror (NULL)); 136 144 return AUBIO_FAIL; 137 145 } … … 139 147 s->scratch_size = s->max_size*s->channels; 140 148 /* allocate data for de/interleaving reallocated when needed. */ 141 if (s->scratch_size >= MAX_SIZE * MAX_CHANNELS) { 149 if (s->scratch_size >= MAX_SIZE * AUBIO_MAX_CHANNELS) { 150 abort(); 142 151 AUBIO_ERR("sink_sndfile: %d x %d exceeds maximum aubio_sink_sndfile buffer size %d\n", 143 s->max_size, s->channels, MAX_ CHANNELS *MAX_CHANNELS);152 s->max_size, s->channels, MAX_SIZE * AUBIO_MAX_CHANNELS); 144 153 return AUBIO_FAIL; 145 154 } -
src/io/sink_wavwrite.c
r71f2e5f r41b985f 20 20 21 21 22 #include " config.h"22 #include "aubio_priv.h" 23 23 24 24 #ifdef HAVE_WAVWRITE 25 25 26 #include "aubio_priv.h"27 26 #include "fvec.h" 28 27 #include "fmat.h" 29 28 #include "io/sink_wavwrite.h" 29 #include "io/ioutils.h" 30 30 31 31 #include <errno.h> 32 32 33 #define MAX_CHANNELS 634 33 #define MAX_SIZE 4096 35 34 … … 105 104 s->channels = 0; 106 105 107 // negative samplerate given, abort108 if ((sint_t)samplerate < 0) goto beach;109 106 // 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; 107 if ((sint_t)samplerate == 0) { 108 return s; 109 } 110 // invalid samplerate given, abort 111 if (aubio_io_validate_samplerate("sink_wavwrite", s->path, samplerate)) { 112 goto beach; 113 } 113 114 114 115 s->samplerate = samplerate; … … 130 131 uint_t aubio_sink_wavwrite_preset_samplerate(aubio_sink_wavwrite_t *s, uint_t samplerate) 131 132 { 132 if ((sint_t)(samplerate) <= 0) return AUBIO_FAIL; 133 if (aubio_io_validate_samplerate("sink_wavwrite", s->path, samplerate)) { 134 return AUBIO_FAIL; 135 } 133 136 s->samplerate = samplerate; 134 137 // automatically open when both samplerate and channels have been set … … 141 144 uint_t aubio_sink_wavwrite_preset_channels(aubio_sink_wavwrite_t *s, uint_t channels) 142 145 { 143 if ((sint_t)(channels) <= 0) return AUBIO_FAIL; 146 if (aubio_io_validate_channels("sink_wavwrite", s->path, channels)) { 147 return AUBIO_FAIL; 148 } 144 149 s->channels = channels; 145 150 // automatically open when both samplerate and channels have been set … … 214 219 s->scratch_size = s->max_size * s->channels; 215 220 /* allocate data for de/interleaving reallocated when needed. */ 216 if (s->scratch_size >= MAX_SIZE * MAX_CHANNELS) {221 if (s->scratch_size >= MAX_SIZE * AUBIO_MAX_CHANNELS) { 217 222 AUBIO_ERR("sink_wavwrite: %d x %d exceeds SIZE maximum buffer size %d\n", 218 s->max_size, s->channels, MAX_SIZE * MAX_CHANNELS);223 s->max_size, s->channels, MAX_SIZE * AUBIO_MAX_CHANNELS); 219 224 goto beach; 220 225 } -
src/io/source.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include "config.h"22 21 #include "aubio_priv.h" 23 22 #include "fvec.h" … … 116 115 } 117 116 #endif /* HAVE_WAVREAD */ 118 //AUBIO_ERROR("source: failed creating aubio source with %s" 119 // " at samplerate %d with hop_size %d\n", uri, samplerate, hop_size); 117 #if !defined(HAVE_WAVREAD) && \ 118 !defined(HAVE_LIBAV) && \ 119 !defined(HAVE_SOURCE_APPLE_AUDIO) && \ 120 !defined(HAVE_SNDFILE) 121 AUBIO_ERROR("source: failed creating with %s at %dHz with hop size %d" 122 " (no source built-in)\n", uri, samplerate, hop_size); 123 #endif 120 124 AUBIO_FREE(s); 121 125 return NULL; -
src/io/source_apple_audio.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include " config.h"21 #include "aubio_priv.h" 22 22 23 23 #ifdef HAVE_SOURCE_APPLE_AUDIO 24 24 25 #include "aubio_priv.h"26 25 #include "fvec.h" 27 26 #include "fmat.h" … … 281 280 { 282 281 OSStatus err = noErr; 283 if (!s->audioFile) { return AUBIO_ FAIL; }282 if (!s->audioFile) { return AUBIO_OK; } 284 283 err = ExtAudioFileDispose(s->audioFile); 285 284 s->audioFile = NULL; -
src/io/source_avcodec.c
r71f2e5f r41b985f 19 19 */ 20 20 21 22 #include "config.h" 21 #include "aubio_priv.h" 23 22 24 23 #ifdef HAVE_LIBAV 24 25 #include <libavcodec/avcodec.h> 26 #include <libavformat/avformat.h> 27 #include <libavresample/avresample.h> 28 #include <libavutil/opt.h> 29 #include <stdlib.h> 25 30 26 31 // determine whether we use libavformat from ffmpeg or from libav … … 33 38 ) 34 39 35 #include <libavcodec/avcodec.h> 36 #include <libavformat/avformat.h> 37 #include <libavresample/avresample.h> 38 #include <libavutil/opt.h> 39 #include <stdlib.h> 40 // backward compatibility with libavcodec55 41 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) 42 #warning "libavcodec55 is deprecated" 43 #define HAVE_AUBIO_LIBAVCODEC_DEPRECATED 1 44 #define av_frame_alloc avcodec_alloc_frame 45 #define av_frame_free avcodec_free_frame 46 #define av_packet_unref av_free_packet 47 #endif 40 48 41 49 #include "aubio_priv.h" … … 60 68 AVCodecContext *avCodecCtx; 61 69 AVFrame *avFrame; 70 AVPacket avPacket; 62 71 AVAudioResampleContext *avr; 63 float *output;72 smpl_t *output; 64 73 uint_t read_samples; 65 74 uint_t read_index; … … 151 160 sint_t selected_stream = -1; 152 161 for (i = 0; i < avFormatCtx->nb_streams; i++) { 162 #if FF_API_LAVF_AVCTX 163 if (avFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { 164 #else 153 165 if (avFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { 166 #endif 154 167 if (selected_stream == -1) { 155 168 selected_stream = i; … … 168 181 169 182 AVCodecContext *avCodecCtx = s->avCodecCtx; 183 #if FF_API_LAVF_AVCTX 184 AVCodecParameters *codecpar = avFormatCtx->streams[selected_stream]->codecpar; 185 if (codecpar == NULL) { 186 AUBIO_ERR("source_avcodec: Could not find decoder for %s", s->path); 187 goto beach; 188 } 189 AVCodec *codec = avcodec_find_decoder(codecpar->codec_id); 190 191 /* Allocate a codec context for the decoder */ 192 avCodecCtx = avcodec_alloc_context3(codec); 193 if (!avCodecCtx) { 194 AUBIO_ERR("source_avcodec: Failed to allocate the %s codec context for path %s\n", 195 av_get_media_type_string(AVMEDIA_TYPE_AUDIO), s->path); 196 goto beach; 197 } 198 #else 170 199 avCodecCtx = avFormatCtx->streams[selected_stream]->codec; 171 200 AVCodec *codec = avcodec_find_decoder(avCodecCtx->codec_id); 201 #endif 172 202 if (codec == NULL) { 173 203 AUBIO_ERR("source_avcodec: Could not find decoder for %s", s->path); 174 204 goto beach; 175 205 } 206 207 #if FF_API_LAVF_AVCTX 208 /* Copy codec parameters from input stream to output codec context */ 209 if ((err = avcodec_parameters_to_context(avCodecCtx, codecpar)) < 0) { 210 AUBIO_ERR("source_avcodec: Failed to copy %s codec parameters to decoder context for %s\n", 211 av_get_media_type_string(AVMEDIA_TYPE_AUDIO), s->path); 212 goto beach; 213 } 214 #endif 176 215 177 216 if ( ( err = avcodec_open2(avCodecCtx, codec, NULL) ) < 0) { … … 206 245 207 246 /* allocate output for avr */ 208 s->output = ( float *)av_malloc(AUBIO_AVCODEC_MAX_BUFFER_SIZE * sizeof(float));247 s->output = (smpl_t *)av_malloc(AUBIO_AVCODEC_MAX_BUFFER_SIZE * sizeof(smpl_t)); 209 248 210 249 s->read_samples = 0; … … 233 272 234 273 void aubio_source_avcodec_reset_resampler(aubio_source_avcodec_t * s, uint_t multi) { 274 // create or reset resampler to/from mono/multi-channel 235 275 if ( (multi != s->multi) || (s->avr == NULL) ) { 236 276 int64_t input_layout = av_get_default_channel_layout(s->input_channels); 237 277 uint_t output_channels = multi ? s->input_channels : 1; 238 278 int64_t output_layout = av_get_default_channel_layout(output_channels); 239 if (s->avr != NULL) { 240 avresample_close( s->avr ); 241 av_free ( s->avr ); 242 s->avr = NULL; 243 } 244 AVAudioResampleContext *avr = s->avr; 245 avr = avresample_alloc_context(); 279 AVAudioResampleContext *avr = avresample_alloc_context(); 280 AVAudioResampleContext *oldavr = s->avr; 246 281 247 282 av_opt_set_int(avr, "in_channel_layout", input_layout, 0); … … 250 285 av_opt_set_int(avr, "out_sample_rate", s->samplerate, 0); 251 286 av_opt_set_int(avr, "in_sample_fmt", s->avCodecCtx->sample_fmt, 0); 287 #if HAVE_AUBIO_DOUBLE 288 av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_DBL, 0); 289 #else 252 290 av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_FLT, 0); 291 #endif 292 // TODO: use planar? 293 //av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); 253 294 int err; 254 295 if ( ( err = avresample_open(avr) ) < 0) { … … 261 302 } 262 303 s->avr = avr; 304 if (oldavr != NULL) { 305 avresample_close( oldavr ); 306 av_free ( oldavr ); 307 oldavr = NULL; 308 } 263 309 s->multi = multi; 264 310 } … … 269 315 AVCodecContext *avCodecCtx = s->avCodecCtx; 270 316 AVFrame *avFrame = s->avFrame; 271 AVPacket avPacket ;317 AVPacket avPacket = s->avPacket; 272 318 av_init_packet (&avPacket); 273 319 AVAudioResampleContext *avr = s->avr; 274 float *output = s->output;320 smpl_t *output = s->output; 275 321 *read_samples = 0; 276 322 … … 291 337 292 338 int got_frame = 0; 339 #if FF_API_LAVF_AVCTX 340 int ret = avcodec_send_packet(avCodecCtx, &avPacket); 341 if (ret < 0 && ret != AVERROR_EOF) { 342 AUBIO_ERR("source_avcodec: error when sending packet for %s\n", s->path); 343 goto beach; 344 } 345 ret = avcodec_receive_frame(avCodecCtx, avFrame); 346 if (ret >= 0) { 347 got_frame = 1; 348 } 349 if (ret < 0) { 350 if (ret == AVERROR(EAGAIN)) { 351 AUBIO_WRN("source_avcodec: output is not available right now - user must try to send new input\n"); 352 } else if (ret == AVERROR_EOF) { 353 AUBIO_WRN("source_avcodec: the decoder has been fully flushed, and there will be no more output frames\n"); 354 } else { 355 AUBIO_ERR("source_avcodec: decoding errors on %s\n", s->path); 356 goto beach; 357 } 358 } 359 #else 293 360 int len = avcodec_decode_audio4(avCodecCtx, avFrame, &got_frame, &avPacket); 294 361 295 362 if (len < 0) { 296 AUBIO_ERR("Error while decoding %s\n", s->path); 297 goto beach; 298 } 363 AUBIO_ERR("source_avcodec: error while decoding %s\n", s->path); 364 goto beach; 365 } 366 #endif 299 367 if (got_frame == 0) { 300 //AUBIO_ERR("Could not get frame for (%s)\n", s->path);368 AUBIO_WRN("source_avcodec: did not get a frame when reading %s\n", s->path); 301 369 goto beach; 302 370 } … … 312 380 (uint8_t **)avFrame->data, in_linesize, in_samples); 313 381 if (out_samples <= 0) { 314 //AUBIO_ERR("No sample found while converting frame (%s)\n", s->path);382 AUBIO_WRN("source_avcodec: no sample found while converting frame (%s)\n", s->path); 315 383 goto beach; 316 384 } … … 329 397 330 398 void aubio_source_avcodec_do(aubio_source_avcodec_t * s, fvec_t * read_data, uint_t * read){ 331 if (s->multi == 1) aubio_source_avcodec_reset_resampler(s, 0);332 399 uint_t i; 333 400 uint_t end = 0; 334 401 uint_t total_wrote = 0; 402 // switch from multi 403 if (s->multi == 1) aubio_source_avcodec_reset_resampler(s, 0); 335 404 while (total_wrote < s->hop_size) { 336 405 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); … … 360 429 361 430 void aubio_source_avcodec_do_multi(aubio_source_avcodec_t * s, fmat_t * read_data, uint_t * read){ 362 if (s->multi == 0) aubio_source_avcodec_reset_resampler(s, 1);363 431 uint_t i,j; 364 432 uint_t end = 0; 365 433 uint_t total_wrote = 0; 434 // switch from mono 435 if (s->multi == 0) aubio_source_avcodec_reset_resampler(s, 1); 366 436 while (total_wrote < s->hop_size) { 367 437 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); … … 408 478 int64_t max_ts = MIN(resampled_pos + 2000, INT64_MAX); 409 479 int seek_flags = AVSEEK_FLAG_FRAME | AVSEEK_FLAG_ANY; 410 int ret = avformat_seek_file(s->avFormatCtx, s->selected_stream, 480 int ret = AUBIO_FAIL; 481 if (s->avFormatCtx != NULL && s->avr != NULL) { 482 ret = AUBIO_OK; 483 } else { 484 AUBIO_ERR("source_avcodec: failed seeking in %s (file not opened?)", s->path); 485 return ret; 486 } 487 if ((sint_t)pos < 0) { 488 AUBIO_ERR("source_avcodec: could not seek %s at %d (seeking position" 489 " should be >= 0)\n", s->path, pos); 490 return AUBIO_FAIL; 491 } 492 ret = avformat_seek_file(s->avFormatCtx, s->selected_stream, 411 493 min_ts, resampled_pos, max_ts, seek_flags); 412 494 if (ret < 0) { 413 AUBIO_ERR(" Failed seeking to %d in file %s", pos, s->path);495 AUBIO_ERR("source_avcodec: failed seeking to %d in file %s", pos, s->path); 414 496 } 415 497 // reset read status … … 442 524 s->avCodecCtx = NULL; 443 525 if (s->avFormatCtx != NULL) { 444 avformat_close_input ( &(s->avFormatCtx) ); 445 } 446 s->avFormatCtx = NULL; 526 avformat_close_input(&s->avFormatCtx); 527 #ifndef HAVE_AUBIO_LIBAVCODEC_DEPRECATED // avoid crash on old libavcodec54 528 avformat_free_context(s->avFormatCtx); 529 #endif 530 s->avFormatCtx = NULL; 531 } 532 av_packet_unref(&s->avPacket); 447 533 return AUBIO_OK; 448 534 } … … 458 544 av_frame_free( &(s->avFrame) ); 459 545 } 460 if (s->path) AUBIO_FREE(s->path);461 546 s->avFrame = NULL; 547 if (s->path) { 548 AUBIO_FREE(s->path); 549 } 550 s->path = NULL; 462 551 AUBIO_FREE(s); 463 552 } -
src/io/source_sndfile.c
r71f2e5f r41b985f 19 19 */ 20 20 21 22 #include "config.h" 21 #include "aubio_priv.h" 23 22 24 23 #ifdef HAVE_SNDFILE … … 26 25 #include <sndfile.h> 27 26 28 #include "aubio_priv.h"29 27 #include "fvec.h" 30 28 #include "fmat.h" … … 33 31 #include "temporal/resampler.h" 34 32 35 #define MAX_CHANNELS 636 33 #define MAX_SIZE 4096 37 #define MAX_SAMPLES MAX_CHANNELS * MAX_SIZE34 #define MAX_SAMPLES AUBIO_MAX_CHANNELS * MAX_SIZE 38 35 39 36 #if !HAVE_AUBIO_DOUBLE … … 141 138 if (s->ratio > 1) { 142 139 // we would need to add a ring buffer for these 143 if ( (uint_t) (s->input_hop_size * s->ratio + .5) != s->hop_size ) {140 if ( (uint_t)FLOOR(s->input_hop_size * s->ratio + .5) != s->hop_size ) { 144 141 AUBIO_ERR("source_sndfile: can not upsample %s from %d to %d\n", s->path, 145 142 s->input_samplerate, s->samplerate); … … 298 295 uint_t aubio_source_sndfile_seek (aubio_source_sndfile_t * s, uint_t pos) { 299 296 uint_t resampled_pos = (uint_t)ROUND(pos / s->ratio); 300 sf_count_t sf_ret = sf_seek (s->handle, resampled_pos, SEEK_SET); 297 sf_count_t sf_ret; 298 if (s->handle == NULL) { 299 AUBIO_ERR("source_sndfile: failed seeking in %s (file not opened?)\n", 300 s->path); 301 return AUBIO_FAIL; 302 } 303 if ((sint_t)pos < 0) { 304 AUBIO_ERR("source_sndfile: could not seek %s at %d (seeking position" 305 " should be >= 0)\n", s->path, pos); 306 return AUBIO_FAIL; 307 } 308 sf_ret = sf_seek (s->handle, resampled_pos, SEEK_SET); 301 309 if (sf_ret == -1) { 302 310 AUBIO_ERR("source_sndfile: Failed seeking %s at %d: %s\n", s->path, pos, sf_strerror (NULL)); … … 313 321 uint_t aubio_source_sndfile_close (aubio_source_sndfile_t *s) { 314 322 if (!s->handle) { 315 return AUBIO_ FAIL;323 return AUBIO_OK; 316 324 } 317 325 if(sf_close(s->handle)) { -
src/io/source_wavread.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include " config.h"21 #include "aubio_priv.h" 22 22 23 23 #ifdef HAVE_WAVREAD 24 24 25 #include "aubio_priv.h"26 25 #include "fvec.h" 27 26 #include "fmat.h" … … 330 329 uint_t end = 0; 331 330 uint_t total_wrote = 0; 331 if (s->fid == NULL) { 332 AUBIO_ERR("source_wavread: could not read from %s (file not opened)\n", 333 s->path); 334 return; 335 } 332 336 while (total_wrote < s->hop_size) { 333 337 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); … … 364 368 uint_t end = 0; 365 369 uint_t total_wrote = 0; 370 if (s->fid == NULL) { 371 AUBIO_ERR("source_wavread: could not read from %s (file not opened)\n", 372 s->path); 373 return; 374 } 366 375 while (total_wrote < s->hop_size) { 367 376 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); … … 404 413 uint_t aubio_source_wavread_seek (aubio_source_wavread_t * s, uint_t pos) { 405 414 uint_t ret = 0; 415 if (s->fid == NULL) { 416 AUBIO_ERR("source_wavread: could not seek %s (file not opened?)\n", s->path, pos); 417 return AUBIO_FAIL; 418 } 406 419 if ((sint_t)pos < 0) { 420 AUBIO_ERR("source_wavread: could not seek %s at %d (seeking position should be >= 0)\n", s->path, pos); 407 421 return AUBIO_FAIL; 408 422 } … … 426 440 427 441 uint_t aubio_source_wavread_close (aubio_source_wavread_t * s) { 428 if ( !s->fid) {429 return AUBIO_ FAIL;442 if (s->fid == NULL) { 443 return AUBIO_OK; 430 444 } 431 445 if (fclose(s->fid)) { -
src/io/utils_apple_audio.c
r71f2e5f r41b985f 1 #include " config.h"1 #include "aubio_priv.h" 2 2 3 3 #if defined(HAVE_SOURCE_APPLE_AUDIO) || defined(HAVE_SINK_APPLE_AUDIO) … … 7 7 // ExtAudioFileRef, AudioStreamBasicDescription, AudioBufferList, ... 8 8 #include <AudioToolbox/AudioToolbox.h> 9 #include "aubio_priv.h"10 9 11 10 int createAubioBufferList(AudioBufferList *bufferList, int channels, int segmentSize); -
src/mathutils.c
r71f2e5f r41b985f 25 25 #include "mathutils.h" 26 26 #include "musicutils.h" 27 #include "config.h"28 27 29 28 /** Window types */ -
src/notes/notes.c
r71f2e5f r41b985f 25 25 #include "notes/notes.h" 26 26 27 #define AUBIO_DEFAULT_NOTES_SILENCE -70. 28 // increase to 10. for .1 cent precision 29 // or to 100. for .01 cent precision 30 #define AUBIO_DEFAULT_CENT_PRECISION 1. 31 #define AUBIO_DEFAULT_NOTES_MINIOI_MS 30. 32 27 33 struct _aubio_notes_t { 28 34 … … 79 85 o->pitch = new_aubio_pitch (pitch_method, o->pitch_buf_size, o->hop_size, o->samplerate); 80 86 if (o->pitch_tolerance != 0.) aubio_pitch_set_tolerance (o->pitch, o->pitch_tolerance); 87 aubio_pitch_set_unit (o->pitch, "midi"); 81 88 o->pitch_output = new_fvec (1); 82 89 … … 91 98 o->newnote = 0.; 92 99 93 o->silence_threshold = -90.; 100 aubio_notes_set_silence(o, AUBIO_DEFAULT_NOTES_SILENCE); 101 aubio_notes_set_minioi_ms (o, AUBIO_DEFAULT_NOTES_MINIOI_MS); 94 102 95 103 return o; … … 98 106 del_aubio_notes(o); 99 107 return NULL; 108 } 109 110 uint_t aubio_notes_set_silence(aubio_notes_t *o, smpl_t silence) 111 { 112 uint_t err = AUBIO_OK; 113 if (aubio_pitch_set_silence(o->pitch, silence) != AUBIO_OK) { 114 err = AUBIO_FAIL; 115 } 116 if (aubio_onset_set_silence(o->onset, silence) != AUBIO_OK) { 117 err = AUBIO_FAIL; 118 } 119 o->silence_threshold = silence; 120 return err; 121 } 122 123 smpl_t aubio_notes_get_silence(const aubio_notes_t *o) 124 { 125 return aubio_pitch_get_silence(o->pitch); 126 } 127 128 uint_t aubio_notes_set_minioi_ms (aubio_notes_t *o, smpl_t minioi_ms) 129 { 130 uint_t err = AUBIO_OK; 131 if (!o->onset || (aubio_onset_set_minioi_ms(o->onset, minioi_ms) != 0)) { 132 err = AUBIO_FAIL; 133 } 134 return err; 135 } 136 137 smpl_t aubio_notes_get_minioi_ms(const aubio_notes_t *o) 138 { 139 return aubio_onset_get_minioi_ms(o->onset); 100 140 } 101 141 … … 109 149 note_buffer->data[i] = note_buffer->data[i + 1]; 110 150 } 111 note_buffer->data[note_buffer->length - 1] = curnote; 151 //note_buffer->data[note_buffer->length - 1] = ROUND(10.*curnote)/10.; 152 note_buffer->data[note_buffer->length - 1] = ROUND(AUBIO_DEFAULT_CENT_PRECISION*curnote); 112 153 return; 113 154 } 114 155 115 static uint_t156 static smpl_t 116 157 aubio_notes_get_latest_note (aubio_notes_t *o) 117 158 { 118 uint_t i; 119 for (i = 0; i < o->note_buffer->length; i++) { 120 o->note_buffer2->data[i] = o->note_buffer->data[i]; 121 } 122 return fvec_median (o->note_buffer2); 159 fvec_copy(o->note_buffer, o->note_buffer2); 160 return fvec_median (o->note_buffer2) / AUBIO_DEFAULT_CENT_PRECISION; 123 161 } 124 162 -
src/notes/notes.h
r71f2e5f r41b985f 16 16 You should have received a copy of the GNU General Public License 17 17 along with aubio. If not, see <http://www.gnu.org/licenses/>. 18 19 */ 20 21 /** \file 22 23 Note detection object 18 24 19 25 */ … … 52 58 53 59 \param o note detection object as returned by new_aubio_notes() 54 \param in input signal of size [hop_size] 55 \param out output notes of size [3] ? FIXME 60 \param input input signal of size [hop_size] 61 \param output output notes, fvec of length 3 62 63 The notes output is a vector of length 3 containing: 64 - 0. the midi note value, or 0 if no note was found 65 - 1. the note velocity 66 - 2. the midi note to turn off 56 67 57 68 */ 58 69 void aubio_notes_do (aubio_notes_t *o, const fvec_t * input, fvec_t * output); 70 71 /** set notes detection silence threshold 72 73 \param o notes detection object as returned by new_aubio_notes() 74 \param silence new silence detection threshold 75 76 \return 0 on success, non-zero otherwise 77 78 */ 79 uint_t aubio_notes_set_silence(aubio_notes_t * o, smpl_t silence); 80 81 /** get notes detection silence threshold 82 83 \param o notes detection object as returned by new_aubio_notes() 84 85 \return current silence threshold 86 87 */ 88 smpl_t aubio_notes_get_silence(const aubio_notes_t * o); 89 90 /** get notes detection minimum inter-onset interval, in millisecond 91 92 \param o notes detection object as returned by new_aubio_notes() 93 94 \return current minimum inter onset interval 95 96 */ 97 smpl_t aubio_notes_get_minioi_ms(const aubio_notes_t *o); 98 99 /** set notes detection minimum inter-onset interval, in millisecond 100 101 \param o notes detection object as returned by new_aubio_notes() 102 \param minioi_ms new inter-onset interval 103 104 \return 0 on success, non-zero otherwise 105 106 */ 107 uint_t aubio_notes_set_minioi_ms (aubio_notes_t *o, smpl_t minioi_ms); 59 108 60 109 #ifdef __cplusplus -
src/onset/peakpicker.c
r71f2e5f r41b985f 186 186 */ 187 187 t->biquad = new_aubio_filter_biquad (0.15998789, 0.31997577, 0.15998789, 188 -0.59488894, 0.23484048); 188 // FIXME: broken since c9e20ca, revert for now 189 //-0.59488894, 0.23484048); 190 0.23484048, 0); 189 191 190 192 return t; -
src/pitch/pitch.c
r71f2e5f r41b985f 112 112 aubio_pitch_t *p = AUBIO_NEW (aubio_pitch_t); 113 113 aubio_pitch_type pitch_type; 114 if (pitch_mode == NULL) { 115 AUBIO_ERR ("pitch: can not use ‘NULL‘ for pitch detection method\n"); 116 goto beach; 117 } 114 118 if (strcmp (pitch_mode, "mcomb") == 0) 115 119 pitch_type = aubio_pitcht_mcomb; … … 139 143 goto beach; 140 144 } else if (bufsize < hopsize) { 141 AUBIO_ERR("pitch: hop size (%d) is larger than win size (%d)\n", bufsize, hopsize);145 AUBIO_ERR("pitch: hop size (%d) is larger than win size (%d)\n", hopsize, bufsize); 142 146 goto beach; 143 147 } else if ((sint_t)samplerate < 1) { … … 156 160 p->buf = new_fvec (bufsize); 157 161 p->p_object = new_aubio_pitchyin (bufsize); 162 if (!p->p_object) goto beach; 158 163 p->detect_cb = aubio_pitch_do_yin; 159 164 p->conf_cb = (aubio_pitch_get_conf_t)aubio_pitchyin_get_confidence; … … 163 168 p->filtered = new_fvec (hopsize); 164 169 p->pv = new_aubio_pvoc (bufsize, hopsize); 170 if (!p->pv) goto beach; 165 171 p->fftgrain = new_cvec (bufsize); 166 172 p->p_object = new_aubio_pitchmcomb (bufsize, hopsize); … … 171 177 p->buf = new_fvec (bufsize); 172 178 p->p_object = new_aubio_pitchfcomb (bufsize, hopsize); 179 if (!p->p_object) goto beach; 173 180 p->detect_cb = aubio_pitch_do_fcomb; 174 181 break; … … 181 188 p->buf = new_fvec (bufsize); 182 189 p->p_object = new_aubio_pitchyinfft (samplerate, bufsize); 190 if (!p->p_object) goto beach; 183 191 p->detect_cb = aubio_pitch_do_yinfft; 184 192 p->conf_cb = (aubio_pitch_get_conf_t)aubio_pitchyinfft_get_confidence; … … 188 196 p->buf = new_fvec (bufsize); 189 197 p->p_object = new_aubio_pitchspecacf (bufsize); 198 if (!p->p_object) goto beach; 190 199 p->detect_cb = aubio_pitch_do_specacf; 191 200 p->conf_cb = (aubio_pitch_get_conf_t)aubio_pitchspecacf_get_tolerance; … … 198 207 199 208 beach: 209 if (p->filtered) del_fvec(p->filtered); 210 if (p->buf) del_fvec(p->buf); 200 211 AUBIO_FREE(p); 201 212 return NULL; -
src/pitch/pitch.h
r71f2e5f r41b985f 151 151 \param mode set pitch units for output 152 152 153 mode can be one of "Hz", "midi", "cent", or "bin". Defaults to "Hz". 154 153 155 \return 0 if successfull, non-zero otherwise 154 156 -
src/pitch/pitchfcomb.c
r71f2e5f r41b985f 54 54 p->fftSize = bufsize; 55 55 p->stepSize = hopsize; 56 p->fft = new_aubio_fft (bufsize); 57 if (!p->fft) goto beach; 56 58 p->winput = new_fvec (bufsize); 57 59 p->fftOut = new_cvec (bufsize); 58 60 p->fftLastPhase = new_fvec (bufsize); 59 p->fft = new_aubio_fft (bufsize);60 61 p->win = new_aubio_window ("hanning", bufsize); 61 62 return p; 63 64 beach: 65 AUBIO_FREE(p); 66 return NULL; 62 67 } 63 68 -
src/pitch/pitchspecacf.c
r71f2e5f r41b985f 43 43 { 44 44 aubio_pitchspecacf_t *p = AUBIO_NEW (aubio_pitchspecacf_t); 45 p->fft = new_aubio_fft (bufsize); 46 if (!p->fft) goto beach; 45 47 p->win = new_aubio_window ("hanningz", bufsize); 46 48 p->winput = new_fvec (bufsize); 47 p->fft = new_aubio_fft (bufsize);48 49 p->fftout = new_fvec (bufsize); 49 50 p->sqrmag = new_fvec (bufsize); … … 52 53 p->confidence = 0.; 53 54 return p; 55 56 beach: 57 AUBIO_FREE(p); 58 return NULL; 54 59 } 55 60 -
src/pitch/pitchyin.c
r71f2e5f r41b985f 128 128 } 129 129 130 131 130 /* all the above in one */ 132 131 void 133 132 aubio_pitchyin_do (aubio_pitchyin_t * o, const fvec_t * input, fvec_t * out) 134 133 { 135 smpl_t tol = o->tol; 136 fvec_t *yin = o->yin; 137 uint_t j, tau = 0; 134 const smpl_t tol = o->tol; 135 fvec_t* yin = o->yin; 136 const smpl_t *input_data = input->data; 137 const uint_t length = yin->length; 138 smpl_t *yin_data = yin->data; 139 uint_t j, tau; 138 140 sint_t period; 139 smpl_t tmp = 0., tmp2 = 0.; 140 yin->data[0] = 1.; 141 for (tau = 1; tau < yin->length; tau++) { 142 yin->data[tau] = 0.; 143 for (j = 0; j < yin->length; j++) { 144 tmp = input->data[j] - input->data[j + tau]; 145 yin->data[tau] += SQR (tmp); 141 smpl_t tmp, tmp2 = 0.; 142 143 yin_data[0] = 1.; 144 for (tau = 1; tau < length; tau++) { 145 yin_data[tau] = 0.; 146 for (j = 0; j < length; j++) { 147 tmp = input_data[j] - input_data[j + tau]; 148 yin_data[tau] += SQR (tmp); 146 149 } 147 tmp2 += yin ->data[tau];150 tmp2 += yin_data[tau]; 148 151 if (tmp2 != 0) { 149 152 yin->data[tau] *= tau / tmp2; … … 152 155 } 153 156 period = tau - 3; 154 if (tau > 4 && (yin ->data[period] < tol) &&155 (yin ->data[period] < yin->data[period + 1])) {157 if (tau > 4 && (yin_data[period] < tol) && 158 (yin_data[period] < yin_data[period + 1])) { 156 159 out->data[0] = fvec_quadratic_peak_pos (yin, period); 157 160 goto beach; -
src/pitch/pitchyinfft.c
r71f2e5f r41b985f 63 63 p->winput = new_fvec (bufsize); 64 64 p->fft = new_aubio_fft (bufsize); 65 if (!p->fft) goto beach; 65 66 p->fftout = new_fvec (bufsize); 66 67 p->sqrmag = new_fvec (bufsize); … … 96 97 p->short_period = (uint_t)ROUND(samplerate / 1300.); 97 98 return p; 99 100 beach: 101 if (p->winput) del_fvec(p->winput); 102 AUBIO_FREE(p); 103 return NULL; 98 104 } 99 105 -
src/spectral/ooura_fft8g.c
r71f2e5f r41b985f 3 3 // - include "aubio_priv.h" (for config.h and types.h) 4 4 // - add missing prototypes 5 // - use COS and SIN macros 5 // - use COS, SIN, and ATAN macros 6 // - add cast to (smpl_t) to avoid float conversion warnings 6 7 // - declare initialization as static 7 8 // - prefix public function with aubio_ooura_ … … 364 365 a[1] = xi; 365 366 } else { 366 a[1] = 0.5 * (a[0] - a[1]);367 a[1] = (smpl_t)0.5 * (a[0] - a[1]); 367 368 a[0] -= a[1]; 368 369 if (n > 4) { … … 693 694 if (nw > 2) { 694 695 nwh = nw >> 1; 695 delta = atan(1.0) / nwh;696 delta = ATAN(1.0) / nwh; 696 697 w[0] = 1; 697 698 w[1] = 0; … … 727 728 if (nc > 1) { 728 729 nch = nc >> 1; 729 delta = atan(1.0) / nch;730 c[0] = cos(delta * nch);731 c[nch] = 0.5 * c[0];730 delta = ATAN(1.0) / nch; 731 c[0] = COS(delta * nch); 732 c[nch] = (smpl_t)0.5 * c[0]; 732 733 for (j = 1; j < nch; j++) { 733 c[j] = 0.5 * cos(delta * j);734 c[nc - j] = 0.5 * sin(delta * j);734 c[j] = (smpl_t)0.5 * COS(delta * j); 735 c[nc - j] = (smpl_t)0.5 * SIN(delta * j); 735 736 } 736 737 } … … 1588 1589 k = n - j; 1589 1590 kk += ks; 1590 wkr = 0.5 - c[nc - kk];1591 wkr = (smpl_t)0.5 - c[nc - kk]; 1591 1592 wki = c[kk]; 1592 1593 xr = a[j] - a[k]; … … 1614 1615 k = n - j; 1615 1616 kk += ks; 1616 wkr = 0.5 - c[nc - kk];1617 wkr = (smpl_t)0.5 - c[nc - kk]; 1617 1618 wki = c[kk]; 1618 1619 xr = a[j] - a[k]; -
src/spectral/phasevoc.c
r71f2e5f r41b985f 89 89 goto beach; 90 90 } else if (win_s < hop_s) { 91 AUBIO_ERR("pvoc: hop size (%d) is larger than win size (%d)\n", win_s, hop_s);91 AUBIO_ERR("pvoc: hop size (%d) is larger than win size (%d)\n", hop_s, win_s); 92 92 goto beach; 93 93 } -
src/synth/sampler.c
r71f2e5f r41b985f 21 21 #include <assert.h> 22 22 23 #include "config.h"24 23 #include "aubio_priv.h" 25 24 #include "fvec.h" -
src/synth/wavetable.c
r71f2e5f r41b985f 20 20 21 21 22 #include "config.h"23 22 #include "aubio_priv.h" 24 23 #include "fvec.h" -
src/tempo/tempo.h
r71f2e5f r41b985f 155 155 \param o beat tracking object 156 156 157 \return confidence with which the tempo has been observed, `0` if no158 consistent value is found.157 \return confidence with which the tempo has been observed, the higher the 158 more confidence, `0` if no consistent value is found. 159 159 160 160 */ -
src/temporal/biquad.c
r71f2e5f r41b985f 42 42 as->data[0] = 1.; 43 43 as->data[1] = a1; 44 as->data[ 1] = a2;44 as->data[2] = a2; 45 45 return AUBIO_OK; 46 46 } -
src/temporal/resampler.c
r71f2e5f r41b985f 18 18 19 19 */ 20 21 #include "config.h"22 20 23 21 #include "aubio_priv.h" -
src/utils/log.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include "config.h"22 21 #include "aubio_priv.h" 23 22 #include "log.h" … … 36 35 FILE *out; 37 36 out = stdout; 38 if (level == AUBIO_LOG_ DBG || level == AUBIO_LOG_ERR) {37 if (level == AUBIO_LOG_ERR || level == AUBIO_LOG_DBG || level == AUBIO_LOG_WRN) { 39 38 out = stderr; 40 39 } -
src/utils/log.h
r71f2e5f r41b985f 46 46 enum aubio_log_level { 47 47 AUBIO_LOG_ERR, /**< critical errors */ 48 AUBIO_LOG_ WRN, /**< warnings */48 AUBIO_LOG_INF, /**< infos */ 49 49 AUBIO_LOG_MSG, /**< general messages */ 50 50 AUBIO_LOG_DBG, /**< debug messages */ 51 AUBIO_LOG_WRN, /**< warnings */ 51 52 AUBIO_LOG_LAST_LEVEL, /**< number of valid levels */ 52 53 }; -
src/utils/parameter.c
r71f2e5f r41b985f 19 19 */ 20 20 21 #include "config.h"22 21 #include "aubio_priv.h" 23 22 #include "parameter.h" -
src/utils/windll.c
r71f2e5f r41b985f 25 25 */ 26 26 27 #include " config.h"27 #include "aubio_priv.h" 28 28 29 29 #ifdef HAVE_WIN_HACKS -
src/vecutils.c
r71f2e5f r41b985f 1 #include "config.h"2 1 #include "aubio_priv.h" 3 2 #include "types.h" -
src/wscript_build
r71f2e5f r41b985f 29 29 elif ctx.env['DEST_OS'] in ['emscripten']: 30 30 build_features = ['cstlib'] 31 else: #linux, darwin, android, mingw, ... 31 elif '--static' in ctx.env['LDFLAGS'] or '--static' in ctx.env['LINKFLAGS']: 32 # static in cflags, ... 33 build_features = ['cstlib'] 34 else: 35 # linux, darwin, android, mingw, ... 32 36 build_features = ['cstlib', 'cshlib'] 37 38 # also install static lib 39 from waflib.Tools.c import cstlib 40 from waflib.Tools.fc import fcstlib 41 fcstlib.inst_to = cstlib.inst_to = '${LIBDIR}' 33 42 34 43 for target in build_features: … … 39 48 40 49 # install headers, except _priv.h ones 41 ctx.install_files('${ PREFIX}/include/aubio/',50 ctx.install_files('${INCLUDEDIR}/aubio/', 42 51 ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']), 43 52 relative_trick=True)
Note: See TracChangeset
for help on using the changeset viewer.