curl https://waf.io/waf-1.8.14 > waf
@[ -d wafilb ] || rm -fr waflib
@chmod +x waf && ./waf --help > /dev/null
- @mv .waf*/waflib . && rm -fr .waf-*
+ @mv .waf*/waflib . && rm -fr .waf*
@sed '/^#==>$$/,$$d' waf > waf2 && mv waf2 waf
@chmod +x waf
f = source(source_path, hop_size = hop_size)
samplerate = f.samplerate
- s = Stream(sample_rate = samplerate, block_length = hop_size)
+ s = Stream(samplerate = samplerate, blocksize = hop_size)
s.start()
read = 0
while 1:
hop_size = 256
duration = 5 # in seconds
- s = Stream(block_length = hop_size)
- g = sink(sink_path, samplerate = s.sample_rate)
+ s = Stream(blocksize = hop_size, channels = 1)
+ g = sink(sink_path, samplerate = int(s.samplerate))
+ print s.channels
s.start()
total_frames = 0
- while total_frames < duration * s.sample_rate:
- vec = s.read(hop_size)
- # mix down to mono
- mono_vec = vec.sum(-1) / float(s.input_channels)
- g(mono_vec, hop_size)
- total_frames += hop_size
+ try:
+ while total_frames < duration * s.samplerate:
+ vec = s.read(hop_size)
+ # mix down to mono
+ mono_vec = vec.sum(-1) / float(s.channels[0])
+ g(mono_vec, hop_size)
+ total_frames += hop_size
+ except KeyboardInterrupt, e:
+ print "stopped after", "%.2f seconds" % (total_frames / s.samplerate)
+ pass
s.stop()
if __name__ == '__main__':
static char Py_fft_doc[] = "fft object";
-AUBIO_DECLARE(fft, uint_t win_s)
+typedef struct
+{
+ PyObject_HEAD
+ aubio_fft_t * o;
+ uint_t win_s;
+ cvec_t *out;
+ fvec_t *rout;
+} Py_fft;
//AUBIO_NEW(fft)
static PyObject *
return (PyObject *) self;
}
+static int
+Py_fft_init (Py_fft * self, PyObject * args, PyObject * kwds)
+{
+ self->o = new_aubio_fft (self->win_s);
+ if (self->o == NULL) {
+ char_t errstr[30];
+ sprintf(errstr, "error creating fft with win_s=%d", self->win_s);
+ PyErr_SetString (PyExc_StandardError, errstr);
+ return -1;
+ }
+ self->out = new_cvec(self->win_s);
+ self->rout = new_fvec(self->win_s);
-AUBIO_INIT(fft, self->win_s)
+ return 0;
+}
-AUBIO_DEL(fft)
+static void
+Py_fft_del (Py_fft *self, PyObject *unused)
+{
+ del_aubio_fft(self->o);
+ del_cvec(self->out);
+ del_fvec(self->rout);
+ self->ob_type->tp_free((PyObject *) self);
+}
static PyObject *
-Py_fft_do(PyObject * self, PyObject * args)
+Py_fft_do(Py_fft * self, PyObject * args)
{
PyObject *input;
fvec_t *vec;
- cvec_t *output;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- output = new_cvec(((Py_fft *) self)->win_s);
-
// compute the function
- aubio_fft_do (((Py_fft *)self)->o, vec, output);
- return (PyObject *)PyAubio_CCvecToPyCvec(output);
+ aubio_fft_do (((Py_fft *)self)->o, vec, self->out);
+ return (PyObject *)PyAubio_CCvecToPyCvec(self->out);
}
AUBIO_MEMBERS_START(fft)
{
PyObject *input;
cvec_t *vec;
- fvec_t *output;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- output = new_fvec(self->win_s);
-
// compute the function
- aubio_fft_rdo (((Py_fft *)self)->o, vec, output);
- return (PyObject *)PyAubio_CFvecToArray(output);
+ aubio_fft_rdo (((Py_fft *)self)->o, vec, self->rout);
+ return (PyObject *)PyAubio_CFvecToArray(self->rout);
}
static PyMethodDef Py_fft_methods[] = {
PyObject_HEAD
aubio_filter_t * o;
uint_t order;
+ fvec_t *out;
} Py_filter;
static char Py_filter_doc[] = "filter object";
if (self->o == NULL) {
return -1;
}
-
+ self->out = new_fvec(Py_default_vector_length);
return 0;
}
static void
Py_filter_del (Py_filter * self)
{
+ del_fvec(self->out);
del_aubio_filter (self->o);
Py_TYPE(self)->tp_free ((PyObject *) self);
}
return NULL;
}
+ // reallocate the output if needed
+ if (vec->length != self->out->length) {
+ del_fvec(self->out);
+ self->out = new_fvec(vec->length);
+ }
// compute the function
- fvec_t * out = new_fvec(vec->length);
- aubio_filter_do_outplace (self->o, vec, out);
- return PyAubio_CFvecToArray(out);
+ aubio_filter_do_outplace (self->o, vec, self->out);
+ return PyAubio_CFvecToArray(self->out);
}
static PyObject *
static char Py_filterbank_doc[] = "filterbank object";
-AUBIO_DECLARE(filterbank, uint_t n_filters; uint_t win_s)
+typedef struct
+{
+ PyObject_HEAD
+ aubio_filterbank_t * o;
+ uint_t n_filters;
+ uint_t win_s;
+ fvec_t *out;
+} Py_filterbank;
//AUBIO_NEW(filterbank)
static PyObject *
return (PyObject *) self;
}
+static int
+Py_filterbank_init (Py_filterbank * self, PyObject * args, PyObject * kwds)
+{
+ self->o = new_aubio_filterbank (self->n_filters, self->win_s);
+ if (self->o == NULL) {
+ char_t errstr[30];
+ sprintf(errstr, "error creating filterbank with n_filters=%d, win_s=%d",
+ self->n_filters, self->win_s);
+ PyErr_SetString (PyExc_StandardError, errstr);
+ return -1;
+ }
+ self->out = new_fvec(self->n_filters);
-AUBIO_INIT(filterbank, self->n_filters, self->win_s)
+ return 0;
+}
-AUBIO_DEL(filterbank)
+static void
+Py_filterbank_del (Py_filterbank *self, PyObject *unused)
+{
+ del_aubio_filterbank(self->o);
+ del_fvec(self->out);
+ self->ob_type->tp_free((PyObject *) self);
+}
static PyObject *
Py_filterbank_do(Py_filterbank * self, PyObject * args)
{
PyObject *input;
cvec_t *vec;
- fvec_t *out;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- out = new_fvec (self->n_filters);
-
// compute the function
- aubio_filterbank_do (self->o, vec, out);
- return (PyObject *)PyAubio_CFvecToArray(out);
+ aubio_filterbank_do (self->o, vec, self->out);
+ return (PyObject *)PyAubio_CFvecToArray(self->out);
}
AUBIO_MEMBERS_START(filterbank)
static char Py_pvoc_doc[] = "pvoc object";
-AUBIO_DECLARE(pvoc, uint_t win_s; uint_t hop_s)
+typedef struct
+{
+ PyObject_HEAD
+ aubio_pvoc_t * o;
+ uint_t win_s;
+ uint_t hop_s;
+ cvec_t *output;
+ fvec_t *routput;
+} Py_pvoc;
+
//AUBIO_NEW(pvoc)
static PyObject *
return NULL;
}
+ self->output = new_cvec(self->win_s);
+ self->routput = new_fvec(self->hop_s);
+
return (PyObject *) self;
}
AUBIO_INIT(pvoc, self->win_s, self->hop_s)
-AUBIO_DEL(pvoc)
+static void
+Py_pvoc_del (Py_pvoc *self, PyObject *unused)
+{
+ del_aubio_pvoc(self->o);
+ del_cvec(self->output);
+ del_fvec(self->routput);
+ self->ob_type->tp_free((PyObject *) self);
+}
+
static PyObject *
Py_pvoc_do(Py_pvoc * self, PyObject * args)
{
PyObject *input;
fvec_t *vec;
- cvec_t *output;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- output = new_cvec(self->win_s);
-
// compute the function
- aubio_pvoc_do (self->o, vec, output);
- return (PyObject *)PyAubio_CCvecToPyCvec(output);
+ aubio_pvoc_do (self->o, vec, self->output);
+ return (PyObject *)PyAubio_CCvecToPyCvec(self->output);
}
AUBIO_MEMBERS_START(pvoc)
{
PyObject *input;
cvec_t *vec;
- fvec_t *output;
-
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
}
return NULL;
}
- output = new_fvec(self->hop_s);
-
// compute the function
- aubio_pvoc_rdo (self->o, vec, output);
- return (PyObject *)PyAubio_CFvecToArray(output);
+ aubio_pvoc_rdo (self->o, vec, self->routput);
+ return (PyObject *)PyAubio_CFvecToArray(self->routput);
}
static PyMethodDef Py_pvoc_methods[] = {
uint_t samplerate;
uint_t channels;
uint_t hop_size;
+ fvec_t *read_to;
+ fmat_t *mread_to;
} Py_source;
static char Py_source_doc[] = ""
self->channels = aubio_source_get_channels ( self->o );
}
+ self->read_to = new_fvec(self->hop_size);
+ self->mread_to = new_fmat (self->channels, self->hop_size);
+
return 0;
}
-AUBIO_DEL(source)
+static void
+Py_source_del (Py_source *self, PyObject *unused)
+{
+ del_aubio_source(self->o);
+ del_fvec(self->read_to);
+ del_fmat(self->mread_to);
+ self->ob_type->tp_free((PyObject *) self);
+}
+
/* function Py_source_do */
static PyObject *
/* output vectors prototypes */
- fvec_t* read_to;
uint_t read;
/* creating output read_to as a new_fvec of length self->hop_size */
- read_to = new_fvec (self->hop_size);
read = 0;
/* compute _do function */
- aubio_source_do (self->o, read_to, &read);
+ aubio_source_do (self->o, self->read_to, &read);
PyObject *outputs = PyList_New(0);
- PyList_Append( outputs, (PyObject *)PyAubio_CFvecToArray (read_to));
- //del_fvec (read_to);
+ PyList_Append( outputs, (PyObject *)PyAubio_CFvecToArray (self->read_to));
PyList_Append( outputs, (PyObject *)PyInt_FromLong (read));
return outputs;
}
/* output vectors prototypes */
- fmat_t* read_to;
uint_t read;
- /* creating output read_to as a new_fvec of length self->hop_size */
- read_to = new_fmat (self->channels, self->hop_size);
+ /* creating output mread_to as a new_fvec of length self->hop_size */
read = 0;
/* compute _do function */
- aubio_source_do_multi (self->o, read_to, &read);
+ aubio_source_do_multi (self->o, self->mread_to, &read);
PyObject *outputs = PyList_New(0);
- PyList_Append( outputs, (PyObject *)PyAubio_CFmatToArray (read_to));
- //del_fvec (read_to);
+ PyList_Append( outputs, (PyObject *)PyAubio_CFmatToArray (self->mread_to));
PyList_Append( outputs, (PyObject *)PyInt_FromLong (read));
return outputs;
}
# default value for variables
aubioinitvalue = {
'uint_t': 0,
+ 'sint_t': 0,
'smpl_t': 0,
'lsmp_t': 0.,
'char_t*': 'NULL',
# aubio to python
aubio2pytypes = {
'uint_t': 'I',
+ 'sint_t': 'I',
'smpl_t': 'f',
'lsmp_t': 'd',
'fvec_t*': 'O',
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.aubio.$(PRODUCT_NAME:rfc1034identifier)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2015 Paul Brossier. All rights reserved.</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
--- /dev/null
+framework module aubio {
+ umbrella header "aubio.h"
+
+ export *
+ module * { export * }
+}
--- /dev/null
+#! /bin/sh
+
+AUBIO_TMPDIR=`mktemp -d /var/tmp/aubio-build-XXXX`
+PACKAGE=aubio
+source VERSION
+VERSION=$AUBIO_MAJOR_VERSION.$AUBIO_MINOR_VERSION.$AUBIO_PATCH_VERSION$AUBIO_VERSION_STATUS
+LIBVERSION=$LIBAUBIO_LT_CUR.$LIBAUBIO_LT_REV.$LIBAUBIO_LT_AGE
+OUTPUTDIR=$PWD/dist
+mkdir -p $OUTPUTDIR
+# add git abbreviated commit hash
+#VERSION+=+$(git log --pretty=format:"%h" -1)
+
+CFLAGS="-Werror -Ofast"
+WAFCONF="--disable-sndfile --disable-avcodec --disable-samplerate --enable-fat" # --disable-memcpy --disable-accelerate"
+
+export VERSION
+
+function cleanup () {
+ rm -rf $AUBIO_TMPDIR
+}
+
+trap cleanup SIGINT SIGTERM
+
+function create_tarballs() {
+ # name version platform
+ # create tarball
+ tarfile=$OUTPUTDIR/$1-$2.$3_binary.tar.bz2
+ tar -C $AUBIO_TMPDIR/dist-$3/ -jcf $tarfile .
+ #rm -rf $AUBIO_TMPDIR/dist-$3
+}
+
+function create_framework() {
+ rm -rf $AUBIO_TMPDIR/framework-$3
+ mkdir -p $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework/$1.framework
+ cp -pr COPYING README.md $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework
+ pushd $AUBIO_TMPDIR/framework-$3
+ cp -pr $OLDPWD/build/src/lib$1.a $1-$2.$3_framework/$1.framework/$1 || \
+ cp -pr $AUBIO_TMPDIR/dist-$3/usr/local/lib/lib$1.$LIBVERSION.dylib \
+ $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework/$1.framework/$1
+ cp -pr $AUBIO_TMPDIR/dist-$3/usr/local/include/$1 $1-$2.$3_framework/$1.framework/Headers
+ cp -pr $OLDPWD/scripts/apple/Modules $1-$2.$3_framework/$1.framework/
+ popd
+}
+
+function create_framework_fat() {
+ rm -rf $AUBIO_TMPDIR/framework-$3
+ mkdir -p $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework/$1.framework
+ cp -pr COPYING README.md $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework
+ pushd $AUBIO_TMPDIR/framework-$3
+ cp -pr $AUBIO_TMPDIR/framework-ios/$1-$2.ios_framework/$1.framework/Headers $1-$2.$3_framework/$1.framework
+ cp -pr $AUBIO_TMPDIR/framework-ios/$1-$2.ios_framework/$1.framework/Modules $1-$2.$3_framework/$1.framework
+ lipo $AUBIO_TMPDIR/framework-ios/$1-$2.ios_framework/$1.framework/$1 \
+ $AUBIO_TMPDIR/framework-iosimulator/$1-$2.iosimulator_framework/$1.framework/$1 \
+ -output $1-$2.$3_framework/$1.framework/$1 -create
+ popd
+}
+
+function create_framework_zip() {
+ # create zip
+ pushd $AUBIO_TMPDIR/framework-$3
+ zipfile=$1-$2.$3_framework.zip
+ zip -qr $zipfile $1-$2.$3_framework
+ popd
+ mv $AUBIO_TMPDIR/framework-$3/$zipfile $OUTPUTDIR
+}
+
+set -x
+set -e
+
+#./waf dist --verbose
+
+for PLATFORM in darwin ios iosimulator
+do
+ rm -rf $AUBIO_TMPDIR/dist-$PLATFORM
+ WAF_OPTIONS="--verbose --destdir $AUBIO_TMPDIR/dist-$PLATFORM --with-target-platform $PLATFORM $WAFCONF"
+ for target in distclean configure build install
+ do
+ CFLAGS="$CFLAGS" ./waf $target $WAF_OPTIONS
+ done
+
+ create_framework $PACKAGE $VERSION $PLATFORM
+ if [ $PLATFORM == 'darwin' ]
+ then
+ # on darwin, build a .tar.bz2 of /usr and a .zip of aubio.framework
+ create_tarballs $PACKAGE $VERSION $PLATFORM
+ create_framework_zip $PACKAGE $VERSION $PLATFORM
+ fi
+ ./waf uninstall $WAF_OPTIONS
+
+done
+
+# after both ios and iosimulator have been built
+PLATFORM=iosuniversal
+create_framework_fat $PACKAGE $VERSION $PLATFORM
+create_framework_zip $PACKAGE $VERSION $PLATFORM
+
+./waf clean
+./waf distclean
+
+cleanup
--- /dev/null
+#! /bin/sh
+
+function checkprog() {
+ type $1 >/dev/null 2>&1 || { echo >&2 "$1 required but not found, aborting."; exit 1; }
+}
+
+checkprog emcc
+checkprog emconfigure
+checkprog emmake
+
+# clean
+emmake ./waf distclean
+
+# configure
+emconfigure ./waf configure --prefix=$EMSCRIPTEN/system/local/ --with-target-platform emscripten
+
+# build
+emmake ./waf --testcmd="node %s"
+
+# intall
+#emmake ./waf install
--- /dev/null
+#! /usr/bin/env bash
+
+# This script sets the environment to execute aubio binaries and python code
+# directly from build/ python/build/ without installing libaubio on the system
+
+# Usage: $ source ./scripts/setenv_local.sh
+
+# WARNING: this script will *overwrite* existing (DY)LD_LIBRARY_PATH and
+# PYTHONPATH variables.
+
+PYTHON_PLATFORM=`python -c "import pkg_resources, sys; print '%s-%s' % (pkg_resources.get_build_platform(), '.'.join(map(str, sys.version_info[0:2])))"`
+
+AUBIODIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
+AUBIOLIB=$AUBIODIR/build/src
+AUBIOPYTHON=$AUBIODIR/python/build/lib.$PYTHON_PLATFORM
+
+if [ "$(dirname $PWD)" == "scripts" ]; then
+ AUBIODIR=$(basename $PWD)
+else
+ AUBIODIR=$(basename $PWD)
+fi
+
+if [ "$(uname)" == "Darwin" ]; then
+ export DYLD_LIBRARY_PATH=$AUBIOLIB
+ echo export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
+else
+ export LD_LIBRARY_PATH=$AUBIOLIB
+ echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+fi
+
+export PYTHONPATH=$AUBIOPYTHON
+echo export PYTHONPATH=$PYTHONPATH
#define aubio_vDSP_maxvi vDSP_maxvi
#define aubio_vDSP_minv vDSP_minv
#define aubio_vDSP_minvi vDSP_minvi
+#define aubio_vDSP_dotpr vDSP_dotpr
#else /* HAVE_AUBIO_DOUBLE */
#define aubio_vDSP_mmov vDSP_mmovD
#define aubio_vDSP_vmul vDSP_vmulD
#define aubio_vDSP_maxvi vDSP_maxviD
#define aubio_vDSP_minv vDSP_minvD
#define aubio_vDSP_minvi vDSP_minviD
+#define aubio_vDSP_dotpr vDSP_dotprD
#endif /* HAVE_AUBIO_DOUBLE */
#endif /* HAVE_ACCELERATE */
#endif
}
+void fmat_vecmul(fmat_t *s, fvec_t *scale, fvec_t *output) {
+ uint_t k;
+#if 0
+ assert(s->height == output->length);
+ assert(s->length == scale->length);
+#endif
+#if !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
+ uint_t j;
+ fvec_zeros(output);
+ for (j = 0; j < s->length; j++) {
+ for (k = 0; k < s->height; k++) {
+ output->data[k] += scale->data[j]
+ * s->data[k][j];
+ }
+ }
+#elif defined(HAVE_ATLAS)
+ for (k = 0; k < s->height; k++) {
+ output->data[k] = aubio_cblas_dot( s->length, scale->data, 1, s->data[k], 1);
+ }
+#elif defined(HAVE_ACCELERATE)
+#if 0
+ // seems slower and less precise (and dangerous?)
+ vDSP_mmul (s->data[0], 1, scale->data, 1, output->data, 1, s->height, 1, s->length);
+#else
+ for (k = 0; k < s->height; k++) {
+ aubio_vDSP_dotpr( scale->data, 1, s->data[k], 1, &(output->data[k]), s->length);
+ }
+#endif
+#endif
+}
*/
void fmat_copy(fmat_t *s, fmat_t *t);
+/* compute the product of a matrix by a vector
+
+ \param s matrix to compute product with
+ \param scale vector to compute product with
+ \param output vector to store restults in
+
+*/
+void fmat_vecmul(fmat_t *s, fvec_t *scale, fvec_t *output);
+
#ifdef __cplusplus
}
#endif
#define MAX_SIZE 4096 // the maximum number of frames that can be written at a time
+void aubio_sink_apple_audio_write(aubio_sink_apple_audio_t *s, uint_t write);
+
struct _aubio_sink_apple_audio_t {
uint_t samplerate;
uint_t channels;
aubio_sink_apple_audio_t * s = AUBIO_NEW(aubio_sink_apple_audio_t);
s->path = uri;
s->max_frames = MAX_SIZE;
- s->async = true;
+ s->async = false;
if (uri == NULL) {
AUBIO_ERROR("sink_apple_audio: Aborted opening null path\n");
}
void aubio_sink_apple_audio_do(aubio_sink_apple_audio_t * s, fvec_t * write_data, uint_t write) {
- OSStatus err = noErr;
UInt32 c, v;
short *data = (short*)s->bufferList.mBuffers[0].mData;
if (write > s->max_frames) {
}
}
}
- if (s->async) {
- err = ExtAudioFileWriteAsync(s->audioFile, write, &s->bufferList);
-
- if (err) {
- char_t errorstr[20];
- AUBIO_ERROR("sink_apple_audio: error while writing %s "
- "in ExtAudioFileWriteAsync (%s), switching to sync\n", s->path,
- getPrintableOSStatusError(errorstr, err));
- s->async = false;
- } else {
- return;
- }
-
- } else {
- err = ExtAudioFileWrite(s->audioFile, write, &s->bufferList);
-
- if (err) {
- char_t errorstr[20];
- AUBIO_ERROR("sink_apple_audio: error while writing %s "
- "in ExtAudioFileWrite (%s)\n", s->path,
- getPrintableOSStatusError(errorstr, err));
- }
- }
- return;
+ aubio_sink_apple_audio_write(s, write);
}
void aubio_sink_apple_audio_do_multi(aubio_sink_apple_audio_t * s, fmat_t * write_data, uint_t write) {
- OSStatus err = noErr;
UInt32 c, v;
short *data = (short*)s->bufferList.mBuffers[0].mData;
if (write > s->max_frames) {
}
}
}
+ aubio_sink_apple_audio_write(s, write);
+}
+
+void aubio_sink_apple_audio_write(aubio_sink_apple_audio_t *s, uint_t write) {
+ OSStatus err = noErr;
if (s->async) {
err = ExtAudioFileWriteAsync(s->audioFile, write, &s->bufferList);
-
if (err) {
char_t errorstr[20];
+ if (err == kExtAudioFileError_AsyncWriteBufferOverflow) {
+ sprintf(errorstr,"buffer overflow");
+ } else if (err == kExtAudioFileError_AsyncWriteTooLarge) {
+ sprintf(errorstr,"write too large");
+ } else {
+ // unknown error
+ getPrintableOSStatusError(errorstr, err);
+ }
AUBIO_ERROR("sink_apple_audio: error while writing %s "
- "in ExtAudioFileWriteAsync (%s), switching to sync\n", s->path,
- getPrintableOSStatusError(errorstr, err));
- s->async = false;
- } else {
- return;
+ "in ExtAudioFileWriteAsync (%s)\n", s->path, errorstr);
}
-
} else {
err = ExtAudioFileWrite(s->audioFile, write, &s->bufferList);
-
if (err) {
char_t errorstr[20];
AUBIO_ERROR("sink_apple_audio: error while writing %s "
getPrintableOSStatusError(errorstr, err));
}
}
- return;
}
uint_t aubio_sink_apple_audio_close(aubio_sink_apple_audio_t * s) {
#define MAX_SIZE 4096
#define MAX_SAMPLES MAX_CHANNELS * MAX_SIZE
+#if !HAVE_AUBIO_DOUBLE
+#define aubio_sf_read_smpl sf_read_float
+#else /* HAVE_AUBIO_DOUBLE */
+#define aubio_sf_read_smpl sf_read_double
+#endif /* HAVE_AUBIO_DOUBLE */
+
struct _aubio_source_sndfile_t {
uint_t hop_size;
uint_t samplerate;
// some temporary memory for sndfile to write at
uint_t scratch_size;
- float *scratch_data;
+ smpl_t *scratch_data;
};
aubio_source_sndfile_t * new_aubio_source_sndfile(char_t * path, uint_t samplerate, uint_t hop_size) {
}
s->samplerate = samplerate;
/* compute input block size required before resampling */
- s->ratio = s->samplerate/(float)s->input_samplerate;
+ s->ratio = s->samplerate/(smpl_t)s->input_samplerate;
s->input_hop_size = (uint_t)FLOOR(s->hop_size / s->ratio + .5);
if (s->input_hop_size * s->input_channels > MAX_SAMPLES) {
/* allocate data for de/interleaving reallocated when needed. */
s->scratch_size = s->input_hop_size * s->input_channels;
- s->scratch_data = AUBIO_ARRAY(float,s->scratch_size);
+ s->scratch_data = AUBIO_ARRAY(smpl_t, s->scratch_size);
return s;
void aubio_source_sndfile_do(aubio_source_sndfile_t * s, fvec_t * read_data, uint_t * read){
uint_t i,j, input_channels = s->input_channels;
/* read from file into scratch_data */
- sf_count_t read_samples = sf_read_float (s->handle, s->scratch_data, s->scratch_size);
+ sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data, s->scratch_size);
/* where to store de-interleaved data */
smpl_t *ptr_data;
void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_data, uint_t * read){
uint_t i,j, input_channels = s->input_channels;
/* do actual reading */
- sf_count_t read_samples = sf_read_float (s->handle, s->scratch_data, s->scratch_size);
+ sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data, s->scratch_size);
/* where to store de-interleaved data */
smpl_t **ptr_data;
// channels of the file, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = 0; i < read_data->height; i++) {
- ptr_data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i];
+ ptr_data[i][j] = s->scratch_data[j * input_channels + i];
}
}
} else {
// channel from the file to the destination matrix, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = 0; i < input_channels; i++) {
- ptr_data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i];
+ ptr_data[i][j] = s->scratch_data[j * input_channels + i];
}
}
}
// of the file to each additional channels, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = input_channels; i < read_data->height; i++) {
- ptr_data[i][j] = (smpl_t)s->scratch_data[j * input_channels + (input_channels - 1)];
+ ptr_data[i][j] = s->scratch_data[j * input_channels + (input_channels - 1)];
}
}
}
void
fvec_shift (fvec_t * s)
{
+ uint_t half = s->length / 2, start = half, j;
+ // if length is odd, middle element is moved to the end
+ if (2 * half < s->length) start ++;
#ifndef HAVE_ATLAS
- uint_t j;
- for (j = 0; j < s->length / 2; j++) {
- ELEM_SWAP (s->data[j], s->data[j + s->length / 2]);
+ for (j = 0; j < half; j++) {
+ ELEM_SWAP (s->data[j], s->data[j + start]);
}
#else
- uint_t half = s->length / 2;
- aubio_cblas_swap(half, s->data, 1, s->data + half, 1);
+ aubio_cblas_swap(half, s->data, 1, s->data + start, 1);
#endif
+ if (start != half) {
+ for (j = 0; j < half; j++) {
+ ELEM_SWAP (s->data[j + start - 1], s->data[j + start]);
+ }
+ }
+}
+
+void
+fvec_ishift (fvec_t * s)
+{
+ uint_t half = s->length / 2, start = half, j;
+ // if length is odd, middle element is moved to the beginning
+ if (2 * half < s->length) start ++;
+#ifndef HAVE_ATLAS
+ for (j = 0; j < half; j++) {
+ ELEM_SWAP (s->data[j], s->data[j + start]);
+ }
+#else
+ aubio_cblas_swap(half, s->data, 1, s->data + start, 1);
+#endif
+ if (start != half) {
+ for (j = 0; j < half; j++) {
+ ELEM_SWAP (s->data[half], s->data[j]);
+ }
+ }
}
smpl_t
smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) {
smpl_t s0, s1, s2; uint_t x0, x2;
+ smpl_t half = .5, two = 2.;
if (pos == 0 || pos == x->length - 1) return pos;
x0 = (pos < 1) ? pos : pos - 1;
x2 = (pos + 1 < x->length) ? pos + 1 : pos;
s0 = x->data[x0];
s1 = x->data[pos];
s2 = x->data[x2];
- return pos + 0.5 * (s0 - s2 ) / (s0 - 2.* s1 + s2);
+ return pos + half * (s0 - s2 ) / (s0 - two * s1 + s2);
}
smpl_t fvec_quadratic_peak_mag (fvec_t *x, smpl_t pos) {
*/
void fvec_shift (fvec_t * v);
+/** swap the left and right halves of a vector
+
+ This function swaps the left part of the signal with the right part of the
+signal. Therefore
+
+ \f$ a[0], a[1], ..., a[\frac{N}{2}], a[\frac{N}{2}+1], ..., a[N-1], a[N] \f$
+
+ becomes
+
+ \f$ a[\frac{N}{2}+1], ..., a[N-1], a[N], a[0], a[1], ..., a[\frac{N}{2}] \f$
+
+ This operation, known as 'ifftshift' in the Matlab Signal Processing Toolbox,
+can be used after computing the inverse FFT to simplify the phase relationship
+of the resulting spectrum. See Amalia de Götzen's paper referred to above.
+
+*/
+void fvec_ishift (fvec_t * v);
+
/** compute the sum of all elements of a vector
\param v vector to compute the sum of
if ((sint_t)hop_size < 1) {
AUBIO_ERR("onset: got hop_size %d, but can not be < 1\n", hop_size);
goto beach;
- } else if ((sint_t)buf_size < 1) {
- AUBIO_ERR("onset: got buffer_size %d, but can not be < 1\n", buf_size);
+ } else if ((sint_t)buf_size < 2) {
+ AUBIO_ERR("onset: got buffer_size %d, but can not be < 2\n", buf_size);
goto beach;
} else if (buf_size < hop_size) {
AUBIO_ERR("onset: hop size (%d) is larger than win size (%d)\n", buf_size, hop_size);
// check parameters are valid
if ((sint_t)hopsize < 1) {
- AUBIO_ERR("onset: got hopsize %d, but can not be < 1\n", hopsize);
+ AUBIO_ERR("pitch: got hopsize %d, but can not be < 1\n", hopsize);
goto beach;
} else if ((sint_t)bufsize < 1) {
- AUBIO_ERR("onset: got buffer_size %d, but can not be < 1\n", bufsize);
+ AUBIO_ERR("pitch: got buffer_size %d, but can not be < 1\n", bufsize);
goto beach;
} else if (bufsize < hopsize) {
- AUBIO_ERR("onset: hop size (%d) is larger than win size (%d)\n", bufsize, hopsize);
+ AUBIO_ERR("pitch: hop size (%d) is larger than win size (%d)\n", bufsize, hopsize);
goto beach;
} else if ((sint_t)samplerate < 1) {
- AUBIO_ERR("onset: samplerate (%d) can not be < 1\n", samplerate);
+ AUBIO_ERR("pitch: samplerate (%d) can not be < 1\n", samplerate);
goto beach;
}
/* bug: should check if size / 8 > post+pre+1 */
uint_t i, j;
uint_t spec_size;
- p->spec_partition = 4;
+ p->spec_partition = 2;
p->ncand = 5;
p->npartials = 5;
p->cutoff = 1.;
p->goodcandidate = 0;
p->phasefreq = bufsize / hopsize / TWO_PI;
p->phasediff = TWO_PI * hopsize / bufsize;
- spec_size = bufsize / p->spec_partition;
+ spec_size = bufsize / p->spec_partition + 1;
//p->pickerfn = quadpick;
//p->biquad = new_biquad(0.1600,0.3200,0.1600, -0.5949, 0.2348);
/* allocate temp memory */
aubio_fft_t * new_aubio_fft (uint_t winsize) {
aubio_fft_t * s = AUBIO_NEW(aubio_fft_t);
- if ((sint_t)winsize < 1) {
- AUBIO_ERR("fft: got winsize %d, but can not be < 1\n", winsize);
+ if ((sint_t)winsize < 2) {
+ AUBIO_ERR("fft: got winsize %d, but can not be < 2\n", winsize);
goto beach;
}
#ifdef HAVE_FFTW3
void
aubio_filterbank_do (aubio_filterbank_t * f, cvec_t * in, fvec_t * out)
{
- uint_t j, fn;
-
/* apply filter to all input channel, provided out has enough channels */
- uint_t max_filters = MIN (f->n_filters, out->length);
- uint_t max_length = MIN (in->length, f->filters->length);
-
- /* reset all values in output vector */
- fvec_zeros (out);
-
- /* for each filter */
- for (fn = 0; fn < max_filters; fn++) {
- /* for each sample */
- for (j = 0; j < max_length; j++) {
- out->data[fn] += in->norm[j] * f->filters->data[fn][j];
- }
- }
+ //uint_t max_filters = MIN (f->n_filters, out->length);
+ //uint_t max_length = MIN (in->length, f->filters->length);
+
+ // view cvec->norm as fvec->data
+ fvec_t tmp;
+ tmp.length = in->length;
+ tmp.data = in->norm;
+
+ fmat_vecmul(f->filters, &tmp, out);
return;
}
/* allocating buffers */
mfcc->in_dct = new_fvec (n_filters);
- mfcc->dct_coeffs = new_fmat (n_filters, n_coefs);
+ mfcc->dct_coeffs = new_fmat (n_coefs, n_filters);
- /* compute DCT transform dct_coeffs[i][j] as
+ /* compute DCT transform dct_coeffs[j][i] as
cos ( j * (i+.5) * PI / n_filters ) */
scaling = 1. / SQRT (n_filters / 2.);
for (i = 0; i < n_filters; i++) {
for (j = 0; j < n_coefs; j++) {
- mfcc->dct_coeffs->data[i][j] =
+ mfcc->dct_coeffs->data[j][i] =
scaling * COS (j * (i + 0.5) * PI / n_filters);
}
- mfcc->dct_coeffs->data[i][0] *= SQRT (2.) / 2.;
+ mfcc->dct_coeffs->data[0][i] *= SQRT (2.) / 2.;
}
return mfcc;
void
aubio_mfcc_do (aubio_mfcc_t * mf, cvec_t * in, fvec_t * out)
{
- uint_t j, k;
-
/* compute filterbank */
aubio_filterbank_do (mf->fb, in, mf->in_dct);
/* raise power */
//fvec_pow (mf->in_dct, 3.);
- /* zeros output */
- fvec_zeros(out);
-
- /* compute discrete cosine transform */
- for (j = 0; j < mf->n_filters; j++) {
- for (k = 0; k < mf->n_coefs; k++) {
- out->data[k] += mf->in_dct->data[j]
- * mf->dct_coeffs->data[j][k];
- }
- }
+ /* compute mfccs */
+ fmat_vecmul(mf->dct_coeffs, mf->in_dct, out);
return;
}
/* calculate rfft */
aubio_fft_rdo(pv->fft,fftgrain,pv->synth);
/* unshift */
- fvec_shift(pv->synth);
+ fvec_ishift(pv->synth);
/* additive synthesis */
aubio_pvoc_addsynth(pv, synthnew);
}
if ((sint_t)hop_s < 1) {
AUBIO_ERR("pvoc: got hop_size %d, but can not be < 1\n", hop_s);
goto beach;
- } else if ((sint_t)win_s < 1) {
- AUBIO_ERR("pvoc: got buffer_size %d, but can not be < 1\n", win_s);
+ } else if ((sint_t)win_s < 2) {
+ AUBIO_ERR("pvoc: got buffer_size %d, but can not be < 2\n", win_s);
goto beach;
} else if (win_s < hop_s) {
AUBIO_ERR("pvoc: hop size (%d) is larger than win size (%d)\n", win_s, hop_s);
#include "mathutils.h"
#include "tempo/tempo.h"
-// TODO implement get/set_delay
-
-/** set current delay
-
- \param o beat tracking object
-
- \return current delay, in samples
-
- */
-uint_t aubio_tempo_get_delay(aubio_tempo_t * o);
-
-/** set current delay
-
- \param o beat tracking object
- \param delay delay to set tempo to, in samples
-
- \return `0` if successful, non-zero otherwise
-
- */
-uint_t aubio_tempo_set_delay(aubio_tempo_t * o, uint_t delay);
-
/* structure to store object state */
struct _aubio_tempo_t {
aubio_specdesc_t * od; /** onset detection */
uint_t hop_size; /** get hop_size */
uint_t total_frames; /** total frames since beginning */
uint_t last_beat; /** time of latest detected beat, in samples */
- uint_t delay; /** delay to remove to last beat, in samples */
+ sint_t delay; /** delay to remove to last beat, in samples */
uint_t last_tatum; /** time of latest detected tatum, in samples */
uint_t tatum_signature; /** number of tatum between each beats */
};
uint_t aubio_tempo_get_last (aubio_tempo_t *o)
{
- return o->last_beat - o->delay;
+ return o->last_beat + o->delay;
}
smpl_t aubio_tempo_get_last_s (aubio_tempo_t *o)
return aubio_tempo_get_last_s (o) * 1000.;
}
-uint_t aubio_tempo_set_delay(aubio_tempo_t * o, uint_t delay) {
+uint_t aubio_tempo_set_delay(aubio_tempo_t * o, sint_t delay) {
o->delay = delay;
return AUBIO_OK;
}
+uint_t aubio_tempo_set_delay_s(aubio_tempo_t * o, smpl_t delay) {
+ o->delay = delay * o->samplerate;
+ return AUBIO_OK;
+}
+
+uint_t aubio_tempo_set_delay_ms(aubio_tempo_t * o, smpl_t delay) {
+ o->delay = 1000. * delay * o->samplerate;
+ return AUBIO_OK;
+}
+
uint_t aubio_tempo_get_delay(aubio_tempo_t * o) {
return o->delay;
}
+smpl_t aubio_tempo_get_delay_s(aubio_tempo_t * o) {
+ return o->delay / (smpl_t)(o->samplerate);
+}
+
+smpl_t aubio_tempo_get_delay_ms(aubio_tempo_t * o) {
+ return o->delay / (smpl_t)(o->samplerate) / 1000.;
+}
+
uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence) {
o->silence = silence;
return AUBIO_OK;
if ((sint_t)hop_size < 1) {
AUBIO_ERR("tempo: got hop size %d, but can not be < 1\n", hop_size);
goto beach;
- } else if ((sint_t)buf_size < 1) {
- AUBIO_ERR("tempo: got window size %d, but can not be < 1\n", buf_size);
+ } else if ((sint_t)buf_size < 2) {
+ AUBIO_ERR("tempo: got window size %d, but can not be < 2\n", buf_size);
goto beach;
} else if (buf_size < hop_size) {
AUBIO_ERR("tempo: hop size (%d) is larger than window size (%d)\n", buf_size, hop_size);
*/
smpl_t aubio_tempo_get_last_tatum(aubio_tempo_t *o);
+/** get current delay
+
+ \param o beat tracking object
+
+ \return current delay, in samples
+
+ */
+uint_t aubio_tempo_get_delay(aubio_tempo_t * o);
+
+/** get current delay in seconds
+
+ \param o beat tracking object
+
+ \return current delay, in seconds
+
+ */
+smpl_t aubio_tempo_get_delay_s(aubio_tempo_t * o);
+
+/** get current delay in ms
+
+ \param o beat tracking object
+
+ \return current delay, in milliseconds
+
+ */
+smpl_t aubio_tempo_get_delay_ms(aubio_tempo_t * o);
+
+/** set current delay
+
+ \param o beat tracking object
+ \param delay delay to set tempo to, in samples
+
+ \return `0` if successful, non-zero otherwise
+
+ */
+uint_t aubio_tempo_set_delay(aubio_tempo_t * o, sint_t delay);
+
+/** set current delay in seconds
+
+ \param o beat tracking object
+ \param delay delay to set tempo to, in seconds
+
+ \return `0` if successful, non-zero otherwise
+
+ */
+uint_t aubio_tempo_set_delay_s(aubio_tempo_t * o, smpl_t delay);
+
+/** set current delay
+
+ \param o beat tracking object
+ \param delay delay to set tempo to, in samples
+
+ \return `0` if successful, non-zero otherwise
+
+ */
+uint_t aubio_tempo_set_delay_ms(aubio_tempo_t * o, smpl_t delay);
+
/** delete tempo detection object
\param o beat tracking object
aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate)
{
uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
- aubio_filter_set_samplerate (f, samplerate);
- bs = aubio_filter_get_feedforward (f);
- as = aubio_filter_get_feedback (f);
- b = bs->data, a = as->data;
- order = aubio_filter_get_order (f);
+ if ((sint_t)samplerate <= 0) {
+ AUBIO_ERROR("aubio_filter: failed setting A-weighting with samplerate %d\n", samplerate);
+ return AUBIO_FAIL;
+ }
+ if (f == NULL) {
+ AUBIO_ERROR("aubio_filter: failed setting A-weighting with filter NULL\n");
+ return AUBIO_FAIL;
+ }
+
+ order = aubio_filter_get_order (f);
if (order != 7) {
- AUBIO_ERROR ("order of A-weighting filter must be 7, not %d\n", order);
+ AUBIO_ERROR ("aubio_filter: order of A-weighting filter must be 7, not %d\n", order);
return 1;
}
+ aubio_filter_set_samplerate (f, samplerate);
+ bs = aubio_filter_get_feedforward (f);
+ as = aubio_filter_get_feedback (f);
+ b = bs->data, a = as->data;
+
/* select coefficients according to sampling frequency */
switch (samplerate) {
new_aubio_filter_a_weighting (uint_t samplerate)
{
aubio_filter_t *f = new_aubio_filter (7);
- aubio_filter_set_a_weighting (f, samplerate);
+ if (aubio_filter_set_a_weighting(f,samplerate) != AUBIO_OK) {
+ del_aubio_filter(f);
+ return NULL;
+ }
return f;
}
aubio_filter_set_c_weighting (aubio_filter_t * f, uint_t samplerate)
{
uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
- aubio_filter_set_samplerate (f, samplerate);
- bs = aubio_filter_get_feedforward (f);
- as = aubio_filter_get_feedback (f);
- b = bs->data, a = as->data;
- order = aubio_filter_get_order (f);
+ if ((sint_t)samplerate <= 0) {
+ AUBIO_ERROR("aubio_filter: failed setting C-weighting with samplerate %d\n", samplerate);
+ return AUBIO_FAIL;
+ }
+ if (f == NULL) {
+ AUBIO_ERROR("aubio_filter: failed setting C-weighting with filter NULL\n");
+ return AUBIO_FAIL;
+ }
+
+ order = aubio_filter_get_order (f);
if ( order != 5 ) {
- AUBIO_ERROR ("order of C-weighting filter must be 5, not %d\n", order);
+ AUBIO_ERROR ("aubio_filter: order of C-weighting filter must be 5, not %d\n", order);
return 1;
}
+ aubio_filter_set_samplerate (f, samplerate);
+ bs = aubio_filter_get_feedforward (f);
+ as = aubio_filter_get_feedback (f);
+ b = bs->data, a = as->data;
+
/* select coefficients according to sampling frequency */
switch (samplerate) {
aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate) {
aubio_filter_t * f = new_aubio_filter(5);
- aubio_filter_set_c_weighting (f, samplerate);
+ if (aubio_filter_set_c_weighting(f,samplerate) != AUBIO_OK) {
+ del_aubio_filter(f);
+ return NULL;
+ }
return f;
}
-
new_aubio_filter (uint_t order)
{
aubio_filter_t *f = AUBIO_NEW (aubio_filter_t);
+ if ((sint_t)order < 1) {
+ AUBIO_FREE(f);
+ return NULL;
+ }
f->x = new_lvec (order);
f->y = new_lvec (order);
f->a = new_lvec (order);
f->samplerate = 0;
f->order = order;
/* set default to identity */
- f->a->data[1] = 1.;
+ f->a->data[0] = 1.;
+ f->b->data[0] = 1.;
return f;
}
build_features = ['cstlib', 'cshlib']
elif ctx.env['DEST_OS'] in ['win32', 'win64']:
build_features = ['cshlib']
+elif ctx.env['DEST_OS'] in ['emscripten']:
+ build_features = ['cstlib']
else: #linux, darwin, android, mingw, ...
build_features = ['cshlib', 'cstlib']
help_str = 'use Atlas library (auto)',
help_disable_str = 'do not use Atlas library')
+ add_option_enable_disable(ctx, 'docs', default = None,
+ help_str = 'build documentation (auto)',
+ help_disable_str = 'do not build documentation')
+
ctx.add_option('--with-target-platform', type='string',
help='set target platform for cross-compilation', dest='target_platform')
DEVROOT = "/Applications/Xcode.app/Contents"
DEVROOT += "/Developer/Platforms/iPhoneOS.platform/Developer"
SDKROOT = "%(DEVROOT)s/SDKs/iPhoneOS.sdk" % locals()
+ ctx.env.CFLAGS += [ '-fembed-bitcode' ]
ctx.env.CFLAGS += [ '-arch', 'arm64' ]
ctx.env.CFLAGS += [ '-arch', 'armv7' ]
ctx.env.CFLAGS += [ '-arch', 'armv7s' ]
ctx.env.CFLAGS += [ '-isysroot' , SDKROOT]
ctx.env.LINKFLAGS += [ '-isysroot' , SDKROOT]
+ if target_platform == 'emscripten':
+ import os.path
+ ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
+ ctx.env.CFLAGS += ['-Oz']
+ ctx.env.cprogram_PATTERN = "%s.js"
+ if (ctx.options.enable_atlas != True):
+ ctx.options.enable_atlas = False
+
# check for required headers
ctx.check(header_name='stdlib.h')
ctx.check(header_name='stdio.h')
ctx.define('AUBIO_PREFIX', ctx.env['PREFIX'])
ctx.define('PACKAGE', APPNAME)
- # check if txt2man is installed, optional
- try:
- ctx.find_program('txt2man', var='TXT2MAN')
- except ctx.errors.ConfigurationError:
- ctx.to_log('txt2man was not found (ignoring)')
+ if (ctx.options.enable_docs != False):
+ # check if txt2man is installed, optional
+ try:
+ ctx.find_program('txt2man', var='TXT2MAN')
+ except ctx.errors.ConfigurationError:
+ ctx.to_log('txt2man was not found (ignoring)')
- # check if doxygen is installed, optional
- try:
- ctx.find_program('doxygen', var='DOXYGEN')
- except ctx.errors.ConfigurationError:
- ctx.to_log('doxygen was not found (ignoring)')
+ # check if doxygen is installed, optional
+ try:
+ ctx.find_program('doxygen', var='DOXYGEN')
+ except ctx.errors.ConfigurationError:
+ ctx.to_log('doxygen was not found (ignoring)')
def build(bld):
bld.env['VERSION'] = VERSION
# add sub directories
bld.recurse('src')
- if bld.env['DEST_OS'] not in ['ios', 'iosimulator']:
- pass
if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
bld.recurse('examples')
bld.recurse('tests')