[SciPy-User] Playing numpy array over speakers

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] Playing numpy array over speakers

Todd
Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 

I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Kiko


2015-03-24 21:39 GMT+01:00 Todd <[hidden email]>:
Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 

I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).

 

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd


On Mar 24, 2015 9:51 PM, "Kiko" <[hidden email]> wrote:
>
>
>
> 2015-03-24 21:39 GMT+01:00 Todd <[hidden email]>:
>>
>> Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 
>>
>> I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).
>
>
> Could this be useful for your use case? http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Beat%20Frequencies.ipynb
>  

Sorry, I should have been more specific.  I am really looking for a way to play audio as part of a script.  Your link would certainly work for playing back sound in an interactive manner in a notebook. However, it is not really useful as part general-purpose script or function,  or when control of the playback is needed. Thank you, though, that is certainly very useful in many situations.


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Hjalmar Turesson
I have a little function that plays back numpy arrays using PyAudio. I think PyAudio is pretty platform independent (but it takes a bit of installing). My code is not perfect, but it is simple and works ok. Want it?

Hjalmar

On Tue, Mar 24, 2015 at 6:15 PM, Todd <[hidden email]> wrote:


On Mar 24, 2015 9:51 PM, "Kiko" <[hidden email]> wrote:
>
>
>
> 2015-03-24 21:39 GMT+01:00 Todd <[hidden email]>:
>>
>> Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 
>>
>> I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).
>
>
> Could this be useful for your use case? http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Beat%20Frequencies.ipynb
>  

Sorry, I should have been more specific.  I am really looking for a way to play audio as part of a script.  Your link would certainly work for playing back sound in an interactive manner in a notebook. However, it is not really useful as part general-purpose script or function,  or when control of the playback is needed. Thank you, though, that is certainly very useful in many situations.


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Tiziano Zito-2
In reply to this post by Todd
On Tue 24 Mar, 21:39, Todd <[hidden email]> wrote:
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
Not exactly what you are looking for, not cross-platform, but may be of inspiration:

https://github.com/stefanv/bytebeats

Tiziano

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Brian Merchant
music21 (http://web.mit.edu/music21/) is in active development, and meant for music analysis and procedural generation...I don't know if it meets the numpy requirement though. From the simple glance that I gave its docs, I don't think it does...but I simply add it to the pile of "possibles", just in case I am wrong. 

I too am very interested in your question, so I am glad you asked it. I hope someone is able to come up with a good answer!


On Tue, Mar 24, 2015 at 2:27 PM, Tiziano Zito <[hidden email]> wrote:
On Tue 24 Mar, 21:39, Todd <[hidden email]> wrote:
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
Not exactly what you are looking for, not cross-platform, but may be of inspiration:

https://github.com/stefanv/bytebeats

Tiziano

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Arnaldo Russo
We have a project called datasounds [0]

Which can transform an array of data to sounds [1]:


Cheers,
Arnaldo.


---
Arnaldo D'Amaral Pereira Granja Russo
Lab. de Estudos dos Oceanos e Clima
Instituto de Oceanografia - FURG



2015-03-24 20:48 GMT-03:00 Brian Merchant <[hidden email]>:
music21 (http://web.mit.edu/music21/) is in active development, and meant for music analysis and procedural generation...I don't know if it meets the numpy requirement though. From the simple glance that I gave its docs, I don't think it does...but I simply add it to the pile of "possibles", just in case I am wrong. 

I too am very interested in your question, so I am glad you asked it. I hope someone is able to come up with a good answer!


On Tue, Mar 24, 2015 at 2:27 PM, Tiziano Zito <[hidden email]> wrote:
On Tue 24 Mar, 21:39, Todd <[hidden email]> wrote:
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
Not exactly what you are looking for, not cross-platform, but may be of inspiration:

https://github.com/stefanv/bytebeats

Tiziano

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Fabrice Silva-2
In reply to this post by Todd
Le mardi 24 mars 2015 à 21:39 +0100, Todd a écrit :
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
>
> I am aware of https://wiki.python.org/moin/Audio/.  However, in all the
> cases there, as far as I can find they either do not support numpy arrays,
> are not cross-platform, cannot playback sound at all, or are unmaintained.
> There is also PySoundCard, which would do what I need but also appears to
> be unmaintained (no release in over a year, and no commits in 5 months, no
> release with serious bugfixes mentioned in commits).

Scikits.audiolab has playback capabilities (at least on linux and mac):
http://cournape.github.io/audiolab/overview.html 
and it does handle numpy arrays

--
Fabrice

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd
On Wed, Mar 25, 2015 at 10:15 AM, Fabrice Silva <[hidden email]> wrote:
Le mardi 24 mars 2015 à 21:39 +0100, Todd a écrit :
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
>
> I am aware of https://wiki.python.org/moin/Audio/.  However, in all the
> cases there, as far as I can find they either do not support numpy arrays,
> are not cross-platform, cannot playback sound at all, or are unmaintained.
> There is also PySoundCard, which would do what I need but also appears to
> be unmaintained (no release in over a year, and no commits in 5 months, no
> release with serious bugfixes mentioned in commits).

Scikits.audiolab has playback capabilities (at least on linux and mac):
http://cournape.github.io/audiolab/overview.html
and it does handle numpy arrays


I saw that, but something that only supports Linux and Mac isn't really that cross-platform.  I use Linux, but a lot of the computer we use run windows.  Thanks, though.

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd
In reply to this post by Arnaldo Russo
On Wed, Mar 25, 2015 at 1:27 AM, Arnaldo Russo <[hidden email]> wrote:
We have a project called datasounds [0]

Which can transform an array of data to sounds [1]:


Cheers,
Arnaldo.



Does it support sound playback?  I couldn't find anything in the documentation or source code about sound playback.



2015-03-24 20:48 GMT-03:00 Brian Merchant <[hidden email]>:

music21 (http://web.mit.edu/music21/) is in active development, and meant for music analysis and procedural generation...I don't know if it meets the numpy requirement though. From the simple glance that I gave its docs, I don't think it does...but I simply add it to the pile of "possibles", just in case I am wrong. 

I too am very interested in your question, so I am glad you asked it. I hope someone is able to come up with a good answer!


On Tue, Mar 24, 2015 at 2:27 PM, Tiziano Zito <[hidden email]> wrote:
On Tue 24 Mar, 21:39, Todd <[hidden email]> wrote:
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
Not exactly what you are looking for, not cross-platform, but may be of inspiration:

https://github.com/stefanv/bytebeats

Tiziano

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd
In reply to this post by Brian Merchant
On Wed, Mar 25, 2015 at 12:48 AM, Brian Merchant <[hidden email]> wrote:
music21 (http://web.mit.edu/music21/) is in active development, and meant for music analysis and procedural generation...I don't know if it meets the numpy requirement though. From the simple glance that I gave its docs, I don't think it does...but I simply add it to the pile of "possibles", just in case I am wrong. 

I too am very interested in your question, so I am glad you asked it. I hope someone is able to come up with a good answer!



It doesn't appear to support numpy, and seems to be designed for producing music, rather than playing raw waveforms.
 
On Tue, Mar 24, 2015 at 2:27 PM, Tiziano Zito <[hidden email]> wrote:
On Tue 24 Mar, 21:39, Todd <[hidden email]> wrote:
> Is anyone aware of a well-maintained, simple, cross-platform python package
> that can play a numpy array as sound over speakers?
Not exactly what you are looking for, not cross-platform, but may be of inspiration:

https://github.com/stefanv/bytebeats

Tiziano

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd
In reply to this post by Hjalmar Turesson
Thanks, that would be useful.  It appears PyAudio is the closest to what I need.  So seeing how to translate numpy data into PyAudio data would be useful.

On Tue, Mar 24, 2015 at 10:27 PM, Hjalmar Turesson <[hidden email]> wrote:
I have a little function that plays back numpy arrays using PyAudio. I think PyAudio is pretty platform independent (but it takes a bit of installing). My code is not perfect, but it is simple and works ok. Want it?

Hjalmar

On Tue, Mar 24, 2015 at 6:15 PM, Todd <[hidden email]> wrote:


On Mar 24, 2015 9:51 PM, "Kiko" <[hidden email]> wrote:
>
>
>
> 2015-03-24 21:39 GMT+01:00 Todd <[hidden email]>:
>>
>> Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 
>>
>> I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).
>
>
> Could this be useful for your use case? http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Beat%20Frequencies.ipynb
>  

Sorry, I should have been more specific.  I am really looking for a way to play audio as part of a script.  Your link would certainly work for playing back sound in an interactive manner in a notebook. However, it is not really useful as part general-purpose script or function,  or when control of the playback is needed. Thank you, though, that is certainly very useful in many situations.


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd
In reply to this post by Todd
On Tue, Mar 24, 2015 at 9:39 PM, Todd <[hidden email]> wrote:
Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 

I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).

So in terms of raw waveform playback (as opposed to music note playback), I have done some more searching and I think I have found something that works.  It is the "audio.io" package (https://pypi.python.org/pypi/audio.io/).  It has a recent release (late 2014), supports numpy arrays, and is cross-platform through PyAudio.  It is just a VERY thin wrapper around PyAudio (less than 100 lines).  However, there is no website, no issue tracker, essentially no documentation, and has several projects copied into its tarball (including setputools, about, and sh).

Here are the reasonably maintained, reasonably relevant alternatives I have been able to find:

PyAudio: maintained, cross-platform, doesn't support numpy.  It seems to be used as a backend by a lot of other projects.

audiolazy: cross-platform, supports numpy, has not seen a release since 2013 but its github repo is still seeing commits so it may have more releases in the future.  Uses PyAudio.  Provides a lot of other powerful audio-handling and audio-processing capabilities.

PySoundCard: cross-platform, supports numpy, has not seen a release in over a year and its github repo has not seen a commit in 5 months, but another related project (PySoundFile) has seen commits and releases recently.  The only option amongst these that does NOT rely on PyAudio.

pydub: maintained, cross-platform, doesn't appear to support numpy but the audio output is undocumented so I can't be sure.  Uses PyAudio or ffmpeg if PyAudio is not available.


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Brian Merchant
Thanks so much for updating us on what you have found! I am very glad to be able to have a chance to explore the possible "solutions" you found!

On Tue, Mar 31, 2015 at 9:02 AM, Todd <[hidden email]> wrote:
On Tue, Mar 24, 2015 at 9:39 PM, Todd <[hidden email]> wrote:
Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 

I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).

So in terms of raw waveform playback (as opposed to music note playback), I have done some more searching and I think I have found something that works.  It is the "audio.io" package (https://pypi.python.org/pypi/audio.io/).  It has a recent release (late 2014), supports numpy arrays, and is cross-platform through PyAudio.  It is just a VERY thin wrapper around PyAudio (less than 100 lines).  However, there is no website, no issue tracker, essentially no documentation, and has several projects copied into its tarball (including setputools, about, and sh).

Here are the reasonably maintained, reasonably relevant alternatives I have been able to find:

PyAudio: maintained, cross-platform, doesn't support numpy.  It seems to be used as a backend by a lot of other projects.

audiolazy: cross-platform, supports numpy, has not seen a release since 2013 but its github repo is still seeing commits so it may have more releases in the future.  Uses PyAudio.  Provides a lot of other powerful audio-handling and audio-processing capabilities.

PySoundCard: cross-platform, supports numpy, has not seen a release in over a year and its github repo has not seen a commit in 5 months, but another related project (PySoundFile) has seen commits and releases recently.  The only option amongst these that does NOT rely on PyAudio.

pydub: maintained, cross-platform, doesn't appear to support numpy but the audio output is undocumented so I can't be sure.  Uses PyAudio or ffmpeg if PyAudio is not available.


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd
In reply to this post by Todd
On Tue, Mar 31, 2015 at 6:02 PM, Todd <[hidden email]> wrote:
On Tue, Mar 24, 2015 at 9:39 PM, Todd <[hidden email]> wrote:
Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 

I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).

So in terms of raw waveform playback (as opposed to music note playback), I have done some more searching and I think I have found something that works.  It is the "audio.io" package (https://pypi.python.org/pypi/audio.io/).  It has a recent release (late 2014), supports numpy arrays, and is cross-platform through PyAudio.  It is just a VERY thin wrapper around PyAudio (less than 100 lines).  However, there is no website, no issue tracker, essentially no documentation, and has several projects copied into its tarball (including setputools, about, and sh).

Here are the reasonably maintained, reasonably relevant alternatives I have been able to find:

PyAudio: maintained, cross-platform, doesn't support numpy.  It seems to be used as a backend by a lot of other projects.

audiolazy: cross-platform, supports numpy, has not seen a release since 2013 but its github repo is still seeing commits so it may have more releases in the future.  Uses PyAudio.  Provides a lot of other powerful audio-handling and audio-processing capabilities.

PySoundCard: cross-platform, supports numpy, has not seen a release in over a year and its github repo has not seen a commit in 5 months, but another related project (PySoundFile) has seen commits and releases recently.  The only option amongst these that does NOT rely on PyAudio.

pydub: maintained, cross-platform, doesn't appear to support numpy but the audio output is undocumented so I can't be sure.  Uses PyAudio or ffmpeg if PyAudio is not available.



Just an update on cross-platform, numpy-compatible sound I/O packages:

I have found some other possibilities:

The "JACK-Client" package (https://pypi.python.org/pypi/JACK-Client/) is the furthest along and most established.  It has been around for almost a year, has three contributors, and has seen four releases.  However, it has gained built-in numpy support since my last update, which is why it hasn't appeared previously.  The maintainer seems to be a member of an established auditory research group with a good open-source software track record.  It seems to be a traditionally MATLAB group but they are adding more and more python packages.

The "sounddevice" package (https://pypi.python.org/pypi/sounddevice/).  It only has only been around for a few months and only has one contributor so far.  However, the maintainer is the same as the maintainer of the "JACK-Client" package, it has a github repo with continued commits, a couple other people submitting issues.  Since "JACK-Client" seems to have done okay, I hope this package will as well.

The "hear" package (https://pypi.python.org/pypi/Hear/) is in a similar situation, although with a different maintainer.  It has been around about the same amount of time, has about the same number of releases, and only has one contributor.  The maintainer seems to have a good track record with open-source software and experience with sound processing, so it has some promise too.

Otherwise, there has been no change.  None of the other packages I listed that support numpy have seen a release in the last year. 

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Sameer Grover
On 16/10/15 19:20, Todd wrote:
On Tue, Mar 31, 2015 at 6:02 PM, Todd <[hidden email]> wrote:
On Tue, Mar 24, 2015 at 9:39 PM, Todd <[hidden email]> wrote:
Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 

I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).

So in terms of raw waveform playback (as opposed to music note playback), I have done some more searching and I think I have found something that works.  It is the "audio.io" package (https://pypi.python.org/pypi/audio.io/).  It has a recent release (late 2014), supports numpy arrays, and is cross-platform through PyAudio.  It is just a VERY thin wrapper around PyAudio (less than 100 lines).  However, there is no website, no issue tracker, essentially no documentation, and has several projects copied into its tarball (including setputools, about, and sh).

Here are the reasonably maintained, reasonably relevant alternatives I have been able to find:

PyAudio: maintained, cross-platform, doesn't support numpy.  It seems to be used as a backend by a lot of other projects.

audiolazy: cross-platform, supports numpy, has not seen a release since 2013 but its github repo is still seeing commits so it may have more releases in the future.  Uses PyAudio.  Provides a lot of other powerful audio-handling and audio-processing capabilities.

PySoundCard: cross-platform, supports numpy, has not seen a release in over a year and its github repo has not seen a commit in 5 months, but another related project (PySoundFile) has seen commits and releases recently.  The only option amongst these that does NOT rely on PyAudio.

pydub: maintained, cross-platform, doesn't appear to support numpy but the audio output is undocumented so I can't be sure.  Uses PyAudio or ffmpeg if PyAudio is not available.



Just an update on cross-platform, numpy-compatible sound I/O packages:

I have found some other possibilities:

The "JACK-Client" package (https://pypi.python.org/pypi/JACK-Client/) is the furthest along and most established.  It has been around for almost a year, has three contributors, and has seen four releases.  However, it has gained built-in numpy support since my last update, which is why it hasn't appeared previously.  The maintainer seems to be a member of an established auditory research group with a good open-source software track record.  It seems to be a traditionally MATLAB group but they are adding more and more python packages.

The "sounddevice" package (https://pypi.python.org/pypi/sounddevice/).  It only has only been around for a few months and only has one contributor so far.  However, the maintainer is the same as the maintainer of the "JACK-Client" package, it has a github repo with continued commits, a couple other people submitting issues.  Since "JACK-Client" seems to have done okay, I hope this package will as well.

The "hear" package (https://pypi.python.org/pypi/Hear/) is in a similar situation, although with a different maintainer.  It has been around about the same amount of time, has about the same number of releases, and only has one contributor.  The maintainer seems to have a good track record with open-source software and experience with sound processing, so it has some promise too.

Otherwise, there has been no change.  None of the other packages I listed that support numpy have seen a release in the last year. 


_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user

https://github.com/standarddeviant/sound4python

I've used this on linux. According to the documentation, it is supposed to work on windows too.

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Playing numpy array over speakers

Todd


On Oct 16, 2015 17:45, "Sameer Grover" <[hidden email]> wrote:
>
> On 16/10/15 19:20, Todd wrote:
>>
>> On Tue, Mar 31, 2015 at 6:02 PM, Todd <[hidden email]> wrote:
>>>
>>> On Tue, Mar 24, 2015 at 9:39 PM, Todd <[hidden email]> wrote:
>>>>
>>>> Is anyone aware of a well-maintained, simple, cross-platform python package that can play a numpy array as sound over speakers? 
>>>>
>>>> I am aware of https://wiki.python.org/moin/Audio/.  However, in all the cases there, as far as I can find they either do not support numpy arrays, are not cross-platform, cannot playback sound at all, or are unmaintained.  There is also PySoundCard, which would do what I need but also appears to be unmaintained (no release in over a year, and no commits in 5 months, no release with serious bugfixes mentioned in commits).
>>>
>>>
>>> So in terms of raw waveform playback (as opposed to music note playback), I have done some more searching and I think I have found something that works.  It is the "audio.io" package (https://pypi.python.org/pypi/audio.io/).  It has a recent release (late 2014), supports numpy arrays, and is cross-platform through PyAudio.  It is just a VERY thin wrapper around PyAudio (less than 100 lines).  However, there is no website, no issue tracker, essentially no documentation, and has several projects copied into its tarball (including setputools, about, and sh).
>>>
>>> Here are the reasonably maintained, reasonably relevant alternatives I have been able to find:
>>>
>>> PyAudio: maintained, cross-platform, doesn't support numpy.  It seems to be used as a backend by a lot of other projects.
>>>
>>> audiolazy: cross-platform, supports numpy, has not seen a release since 2013 but its github repo is still seeing commits so it may have more releases in the future.  Uses PyAudio.  Provides a lot of other powerful audio-handling and audio-processing capabilities.
>>>
>>> PySoundCard: cross-platform, supports numpy, has not seen a release in over a year and its github repo has not seen a commit in 5 months, but another related project (PySoundFile) has seen commits and releases recently.  The only option amongst these that does NOT rely on PyAudio.
>>>
>>> pydub: maintained, cross-platform, doesn't appear to support numpy but the audio output is undocumented so I can't be sure.  Uses PyAudio or ffmpeg if PyAudio is not available.
>>>
>>
>>
>> Just an update on cross-platform, numpy-compatible sound I/O packages:
>>
>> I have found some other possibilities:
>>
>> The "JACK-Client" package (https://pypi.python.org/pypi/JACK-Client/) is the furthest along and most established.  It has been around for almost a year, has three contributors, and has seen four releases.  However, it has gained built-in numpy support since my last update, which is why it hasn't appeared previously.  The maintainer seems to be a member of an established auditory research group with a good open-source software track record.  It seems to be a traditionally MATLAB group but they are adding more and more python packages.
>>
>> The "sounddevice" package (https://pypi.python.org/pypi/sounddevice/).  It only has only been around for a few months and only has one contributor so far.  However, the maintainer is the same as the maintainer of the "JACK-Client" package, it has a github repo with continued commits, a couple other people submitting issues.  Since "JACK-Client" seems to have done okay, I hope this package will as well.
>>
>> The "hear" package (https://pypi.python.org/pypi/Hear/) is in a similar situation, although with a different maintainer.  It has been around about the same amount of time, has about the same number of releases, and only has one contributor.  The maintainer seems to have a good track record with open-source software and experience with sound processing, so it has some promise too.
>>
>> Otherwise, there has been no change.  None of the other packages I listed that support numpy have seen a release in the last year. 
>>
>>
>>
>
> https://github.com/standarddeviant/sound4python
>
> I've used this on linux. According to the documentation, it is supposed to work on windows too.

It looks like it hasn't received any commits in the last year, though.


_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user