-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
38 lines (32 loc) · 1.29 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import numpy
from Cython.Distutils import build_ext
from distutils.core import setup
from distutils.extension import Extension
gpu_fft_src_path = '/opt/vc/src/hello_pi/hello_fft/' # gpu fft is directly included in Raspbian
gpu_fft_source_files = ('gpu_fft_base.c', 'gpu_fft.c', 'gpu_fft_shaders.c',
'gpu_fft_twiddles.c', 'gpu_fft_trans.c', 'mailbox.c')
sources = ['src/rpi_audio_levels.pyx',
'src/_rpi_audio_levels.c']
sources.extend([gpu_fft_src_path + p for p in gpu_fft_source_files])
README = """Python binding allowing to retrieve audio levels by frequency bands given
audio samples (power spectrum in fact), on a Raspberry Pi, using GPU FFT"""
setup(
name = "rpi_audio_levels",
version = '0.1.1',
url = 'https://github.com/colin-guyon/rpi-audio-levels',
author = 'Colin Guyon',
description = 'Python binding for Raspberry Pi GPU FFTerface',
long_description = README,
install_requires=[
'cython>=0.19.1',
'numpy',
],
cmdclass={'build_ext': build_ext},
include_dirs=[numpy.get_include()],
ext_modules=[
Extension('rpi_audio_levels',
sources=sources,
extra_compile_args=['-I' + gpu_fft_src_path],
extra_link_args=['-lrt', '-lm'])]
)