--- /dev/null
+
+try:
+ from aubio.aubiowrapper import *
+except ImportError:
+ try:
+ import os
+ import sys
+ cur_dir = os.path.dirname(sys.argv[0])
+ sys.path.append(os.path.join(cur_dir,'..','..','python'))
+ sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
+ from aubio.aubiowrapper import *
+ except ImportError:
+ raise
import numpy
import sys
-from aubio.aubiowrapper import *
+from localaubio import *
win_size = 2048
channels = 1
filterbank = new_aubio_filterbank_mfcc(n_filters, win_size, samplerate,
0., samplerate)
-
mfcc_filters = []
for channel in range(n_filters):
vec = aubio_filterbank_getchannel(filterbank,channel)
--- /dev/null
+
+# add ${src}/python and ${src}/python/aubio/.libs to python path
+# so the script is runnable from a compiled source tree.
+
+try:
+ from aubio.aubiowrapper import *
+except ImportError:
+ try:
+ import os
+ import sys
+ cur_dir = os.path.dirname(sys.argv[0])
+ sys.path.append(os.path.join(cur_dir,'..','..','python'))
+ sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
+ from aubio.aubiowrapper import *
+ except ImportError:
+ raise
+else:
+ raise ImportError, "Note: the aubio module could be imported without adding the source directory to your path."
#! /usr/bin/python
-# add ${src}/python and ${src}/python/aubio/.libs to python path
-# so the script is runnable from a compiled source tree.
-import sys, os
-
-cur_dir = os.path.dirname(sys.argv[0])
-sys.path.append(os.path.join(cur_dir,'..','..','python'))
-sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
-
import unittest
from glob import glob
-import unittest
-
-from aubio.aubiowrapper import *
+from template import aubio_unit_template
+from localaubio import *
buf_size = 2048
channels = 3
-class cvec_test_case(unittest.TestCase):
+class cvec_unit(aubio_unit_template):
def setUp(self):
self.vector = new_cvec(buf_size, channels)
-import unittest
-
-from aubio.aubiowrapper import *
+from template import aubio_unit_template
+from localaubio import *
buf_size = 2048
channels = 3
-class fvec_test_case(unittest.TestCase):
+class fvec_unit(aubio_unit_template):
def setUp(self):
self.vector = new_fvec(buf_size, channels)
from template import aubio_unit_template
-
-from aubio.aubiowrapper import *
+from localaubio import *
buf_size = 7
channels = 1
-
import unittest
class aubio_unit_template(unittest.TestCase):