feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 5c6b264 was
06dba46,
checked in by Paul Brossier <piem@piem.org>, 11 years ago
|
wscript: small tweaks to with mingw32
Signed-off-by: Paul Brossier <piem@piem.org>
|
-
Property mode set to
100644
|
File size:
952 bytes
|
Rev | Line | |
---|
[474a573] | 1 | #include <time.h> |
---|
[248da64] | 2 | #include <stdlib.h> |
---|
| 3 | #include <stdio.h> |
---|
[474a573] | 4 | #include <math.h> |
---|
| 5 | #include <assert.h> |
---|
[06dba46] | 6 | #include "config.h" |
---|
[248da64] | 7 | |
---|
[474a573] | 8 | #define PRINT_ERR(format, args...) fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args) |
---|
[248da64] | 9 | #define PRINT_MSG(format, args...) fprintf(stdout, format , ##args) |
---|
| 10 | #define PRINT_DBG(format, args...) fprintf(stderr, format , ##args) |
---|
[474a573] | 11 | #define PRINT_WRN(format, args...) fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args) |
---|
| 12 | |
---|
[06dba46] | 13 | #ifdef HAVE_WIN_HACKS |
---|
| 14 | // http://en.wikipedia.org/wiki/Linear_congruential_generator |
---|
| 15 | // no srandom/random on win32 |
---|
| 16 | |
---|
| 17 | uint_t srandom_seed = 1029; |
---|
| 18 | |
---|
| 19 | void srandom(uint_t new_seed) { |
---|
| 20 | srandom_seed = new_seed; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | uint_t random(void) { |
---|
| 24 | srandom_seed = 1664525 * srandom_seed + 1013904223; |
---|
| 25 | return srandom_seed; |
---|
| 26 | } |
---|
| 27 | #endif |
---|
| 28 | |
---|
[474a573] | 29 | void utils_init_random () { |
---|
| 30 | time_t now = time(0); |
---|
| 31 | struct tm *tm_struct = localtime(&now); |
---|
| 32 | int seed = tm_struct->tm_sec; |
---|
| 33 | //PRINT_WRN("current seed: %d\n", seed); |
---|
| 34 | srandom (seed); |
---|
| 35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.