hamiltron
Posts: 4
Joined: Tue Dec 01, 2015 3:15 am

New Audio Package for Python3

Wed Dec 02, 2015 8:36 pm

Hey everyone,

I just released the simpleaudio package for Python 3 (https://pypi.python.org/pypi/simpleaudio/1.0.0) which allows cross-platform audio playback. Documentation and tutorial are here: http://simpleaudio.readthedocs.org/.

This interface is asynchronous so it plays nice with GUI apps. It requires all the audio up front so it's better suited for sound-effects and playing short clips; it won't work for streaming or real-time audio generation. It does work with Numpy arrays. I have tested it on a Model B with the 3.5 mm audio jack.

Enjoy.

-Joe H

tvjon
Posts: 786
Joined: Mon Jan 07, 2013 9:11 am

Re: New Audio Package for Python3

Thu Dec 03, 2015 7:28 pm

Hello, sounds interesting, but no joy building, or even installing :(

Info here:

https://pypi.python.org/pypi/simpleaudio/1.0.0

refers to:

https://github.com/hamiltron/simpleaudio

which is a 404 as itś wrong. Looks like itś:

https://github.com/hamiltron/py-simple-audio

Both attempts result in:

------------------------------------------------------------
/usr/bin/pip run on Thu Dec 3 19:02:01 2015
Downloading/unpacking simpleaudio
Getting page https://pypi.python.org/simple/simpleaudio/
URLs to search for versions for simpleaudio:
* https://pypi.python.org/simple/simpleaudio/
Analyzing links from page https://pypi.python.org/simple/simpleaudio/
Skipping https://pypi.python.org/packages/cp33/s ... ae73d427e6 (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp33/s ... 98903ae13c (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp33/s ... 30f62951cc (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp34/s ... e36628cfb1 (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp34/s ... 1228dd9bab (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp34/s ... a33533671f (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp35/s ... 7c91cc580b (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp35/s ... 35fcba4a9a (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Skipping https://pypi.python.org/packages/cp35/s ... 8e6d1efb22 (from https://pypi.python.org/simple/simpleaudio/) because it is not compatible with this Python
Found link https://pypi.python.org/packages/source ... ead7e53fe1 (from https://pypi.python.org/simple/simpleaudio/), version: 1.0.0
Downloading from URL https://pypi.python.org/packages/source ... ead7e53fe1 (from https://pypi.python.org/simple/simpleaudio/)
Running setup.py (path:/tmp/pip-build-UmFyQK/simpleaudio/setup.py) egg_info for package simpleaudio
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-UmFyQK/simpleaudio/setup.py", line 40, in <module>
encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "/tmp/pip-build-UmFyQK/simpleaudio/setup.py", line 40, in <module>

encoding='utf-8') as f:

TypeError: 'encoding' is an invalid keyword argument for this function

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-UmFyQK/simpleaudio
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1230, in prepare_files
req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 326, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-UmFyQK/simpleaudio


Any ideas please?

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: New Audio Package for Python3

Thu Dec 03, 2015 8:37 pm

Any ideas please?
Docs state clearly it's for python 3. Your error messages show you're using python 2...

tvjon
Posts: 786
Joined: Mon Jan 07, 2013 9:11 am

Re: New Audio Package for Python3

Thu Dec 03, 2015 8:59 pm

Yes, I understand that...

Python3 commands do not work either, eg.,


sudo python3-pip install simpleaudio

sudo: python3-pip: command not found

Well, it does exist, but Iĺl humour it anyway..,

$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: New Audio Package for Python3

Fri Dec 04, 2015 8:28 am

tvjon wrote:sudo python3-pip install simpleaudio
The command is not python3-pip but be

Code: Select all

sudo pip3 install simpleaudio
or

Code: Select all

sudo pip-3.2 install simpleaudio
depending on your OS version

tvjon
Posts: 786
Joined: Mon Jan 07, 2013 9:11 am

Re: New Audio Package for Python3

Fri Dec 04, 2015 12:22 pm

What a lot of pips!

No time to test it now, but pip3 seems to have installed it, thank you.

hamiltron
Posts: 4
Joined: Tue Dec 01, 2015 3:15 am

Re: New Audio Package for Python3

Sat Dec 05, 2015 12:44 am

tvjon,

Thanks for your feedback. I fixed the link to the Github repo on PyPI. ... And yes, as pointed out, Python 3 only.

I share your sentiments about there being inconsistent naming of pip between platforms - I even have a note about this in the docs, but it will probably always be a pain point as long as that's the case.

-Joe

Return to “Graphics, sound and multimedia”