forked from hamiltron/py-simple-audio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
73 lines (65 loc) · 2.72 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Simpleaudio Python Extension
# Copyright (C) 2015, Joe Hamilton
# MIT License (see LICENSE.txt)
from setuptools import setup, Extension
import sys
from os import path
platform_sources = []
platform_libs = []
platform_link_args = []
platform_compile_args = []
if sys.platform == 'darwin':
platform_sources = ['c_src/simpleaudio_mac.c', 'c_src/posix_mutex.c']
platform_link_args = ['-framework', 'AudioToolbox']
platform_compile_args = ['-mmacosx-version-min=10.6']
elif sys.platform.startswith("linux"):
platform_sources = ['c_src/simpleaudio_alsa.c', 'c_src/posix_mutex.c']
platform_libs = ['asound']
elif sys.platform == 'win32':
platform_sources = ['c_src/simpleaudio_win.c', 'c_src/windows_mutex.c']
platform_libs = ['Winmm', 'User32']
else:
pass
# define a compiler macro for unsupported ?
simpleaudio_c_ext = Extension(
'simpleaudio._simpleaudio',
sources=platform_sources + ['c_src/simpleaudio.c'],
libraries=platform_libs,
extra_compile_args=platform_compile_args,
extra_link_args=platform_link_args,
define_macros=[('DEBUG', '0')])
# attempt to generate the version from git tag and commit
VERSION = "1.0.2"
# Get the long description from the relevant file
with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst'),
encoding='utf-8') as f:
long_description = f.read()
setup(
name='simpleaudio',
version=VERSION,
license='MIT',
description="Simple, asynchronous audio playback for Python 3.",
long_description=long_description,
author='Joe Hamilton',
author_email='[email protected]',
url='https://github.com/hamiltron/py-simple-audio',
keywords=['audio', 'wave', 'media', 'multimedia',
'sound', 'alsa', 'coreaudio', 'winmm', 'music'],
classifiers=['License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Multimedia :: Sound/Audio',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X'],
test_suite="tests",
py_modules=["simpleaudio.shiny", "simpleaudio.functionchecks"],
ext_modules=[simpleaudio_c_ext],
packages=['simpleaudio'],
package_dir={'simpleaudio': 'simpleaudio'},
package_data={'simpleaudio': ['test_audio/c.wav', 'test_audio/e.wav',
'test_audio/g.wav',
'test_audio/left_right.wav',
'test_audio/notes_2_16_44.wav']},)