Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -1,32 +1,65 @@ | |||
| 1 | Python aubio module | 1 | Python aubio module |
| 2 | =================== | 2 | =================== |
| 3 | 3 | ||
| 4 | This module wraps the aubio library for python using the numpy module. | 4 | This module wraps the aubio library for Python using the numpy module. |
| 5 | 5 | ||
| 6 | See the [Python/C API Reference | 6 | Before compiling this module, you must have compiled libaubio. |
| 7 | Manual] (http://docs.python.org/c-api/index.html) and the [Numpy/C API | 7 | |
| 8 | Reference](http://docs.scipy.org/doc/numpy/reference/c-api.html) | 8 | For more information about how this module works, please refer to the [Python/C |
| 9 | API Reference Manual] (http://docs.python.org/c-api/index.html) and the | ||
| 10 | [Numpy/C API Reference](http://docs.scipy.org/doc/numpy/reference/c-api.html). | ||
| 9 | 11 | ||
| 10 | Compiling python aubio | 12 | Compiling python aubio |
| 11 | ---------------------- | 13 | ---------------------- |
| 12 | 14 | ||
| 13 | You should be able to build the aubio python module out of the box: | 15 | After libaubio has been build successfully, and provided Python development |
| 16 | headers and numpy can be found on your system, you should be able to build the | ||
| 17 | aubio Python module: | ||
| 18 | |||
| 19 | $ ./setup.py build | ||
| 20 | |||
| 21 | To find out more about `setup.py` options: | ||
| 22 | |||
| 23 | $ ./setup.py --help | ||
| 24 | |||
| 25 | Installing | ||
| 26 | ---------- | ||
| 27 | |||
| 28 | To install the Python module: | ||
| 14 | 29 | ||
| 15 | $ python setup.py build | 30 | $ ./setup.py install |
| 16 | 31 | ||
| 17 | To use the python module without installing it, set PYTHONPATH: | 32 | Using the Python module |
| 33 | ----------------------- | ||
| 34 | |||
| 35 | Once the aubio library and the Python module are installed, you will be able to | ||
| 36 | import the aubio module: | ||
| 37 | |||
| 38 | $ python | ||
| 39 | [...] | ||
| 40 | >>> import aubio | ||
| 41 | >>> | ||
| 42 | |||
| 43 | Alternatively, you may want to use the Python module without installing it by | ||
| 44 | setting PYTHONPATH: | ||
| 18 | 45 | ||
| 19 | $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests | 46 | $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests |
| 20 | 47 | ||
| 21 | And LD_LIBRARY_PATH: | 48 | Similarly, you can use the aubio module without installing libaubio by pointing |
| 49 | LD_LIBRARY_PATH to the path libaubio can be found at: | ||
| 22 | 50 | ||
| 23 | $ export LD_LIBRARY_PATH=$PWD/../build/src | 51 | $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:PWD/../build/src |
| 24 | 52 | ||
| 25 | Or on macosx systems: | 53 | Or on Mac OS X systems, setting DYLD_LIBRARY_PATH: |
| 26 | 54 | ||
| 27 | $ export DYLD_LIBRARY_PATH=$PWD/../build/src | 55 | $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/../build/src |
| 28 | 56 | ||
| 29 | The you should be able to run the tests: | 57 | Testing the Python module |
| 58 | ------------------------- | ||
| 59 | |||
| 60 | Once both the C library and the Python module have been built correctly, and | ||
| 61 | after you have installed them (or setting the environment variable correctly), | ||
| 62 | you should be able to run the tests: | ||
| 30 | 63 | ||
| 31 | $ ./tests/run_all_tests | 64 | $ ./tests/run_all_tests |
| 32 | 65 | ||
| @@ -34,8 +67,7 @@ And to try out the demos: · 1 unmodified line | |||
| 34 | 67 | ||
| 35 | $ ./demos/demo_source.wav ~/test.wav | 68 | $ ./demos/demo_source.wav ~/test.wav |
| 36 | 69 | ||
| 37 | Additional tools | 70 | You need to install additional modules to run some of the demos. For |
| 38 | ---------------- | 71 | instance, several demos use [matplotlib](http://matplotlib.org/) to draw plots. |
| 39 | 72 | Some more demos use [PySoundCard](https://github.com/bastibe/PySoundCard) to | |
| 40 | To use some of the demo scripts, you will need | 73 | play and record sounds. |
| 41 | [matplotlib](http://matplotlib.org/). | ||