playsound
Pure Python, cross platform, single function module with no dependencies for playing sounds.
Installation
Install via pip:
$ pip install playsound
Done.
If you insist on the (slightly) harder way of installing, from source, you know how to do it already and don’t need my help.
This library might be uploaded to github at some point at https://github.com/TaylorSMarks
Quick Start
Once you’ve installed, you can really quickly verified that it works with just this:
>>> from playsound import playsound
>>> playsound('/path/to/a/sound/file/you/want/to/play.wav')
Documentation
The playsound module contains only one thing - the function (also named) playsound.
It requires one argument - the path to the file with the sound you’d like to play.
WAVE files should definitely work on all platforms. MP3 is known to work on OS X. Other format/platform combos may also work.
Relies on winsound.PlaySound on Windows, AppKit.NSSound on OS X, and ossaudiodev on Linux.
There’s an optional second argument, block, which is set to True by default. Setting it to False does what you’d expect on OS X and Windows. It does nothing on Linux.
Requirements
playsound should work on any version of OS X, Windows, or Linux, and any version of Python since 2.3. So basically there are no requirements.
Admittedly, I haven’t tested it on particularly old versions of Python or OS X, and I haven’t tested it on Linux at all, but it should just work everywhere.
Copyright
This software is Copyright (c) 2016 Taylor Marks <taylor@marksfam.com>.
See the bundled LICENSE file for more information.
Metadata
Release files for playsound 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| playsound-1.0.0.tar.gz | 3.5 kB | Without provenance | Details for playsound-1.0.0.tar.gz |
Release files / playsound-1.0.0.tar.gz
| Download URL | playsound-1.0.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cbd5f513e34b5b051382a07460f3d9d288b1fbee8af684ac9cbb59bf9ea69ca
|
|
BLAKE2b-256 checksum How to use checksums |
37aa62fa4247dab9221e503d0798c8fc5403c4a973eef0d1e0b2d2099a00d1f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for playsound 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.