Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Pure Python, cross platform, single function module with no dependencies for playing sounds.
Pure Python, cross platform, single function module with no dependencies for playing sounds.
Install via pip:
.. code-block:: bash
$ 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.
The latest version of the source code can be found at: https://github.com/TaylorSMarks/playsound
Once you've installed, you can really quickly verified that it works with just this:
.. code-block:: python
>>> from playsound import playsound
>>> playsound('/path/to/a/sound/file/you/want/to/play.mp3')
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. This may be a local file, or a URL.
There's an optional second argument, block, which is set to True by default. Setting it to False makes the function run asynchronously.
On Windows, uses windll.winmm. WAVE and MP3 have been tested and are known to work. Other file formats may work as well.
On OS X, uses AppKit.NSSound. WAVE and MP3 have been tested and are known to work. In general, anything QuickTime can play, playsound should be able to play, for OS X.
On Linux, uses GStreamer. Known to work on Ubuntu 14.04 and ElementaryOS Loki. I expect any Linux distro with a standard gnome desktop experience should work.
If you'd like other Linux distros (or any other OS) to work, submit a PR adding in support for it, but please make sure it passes the tests (see below).
Playsound includes a small set of tests - if you're making a PR, please ensure that you have no regressions and all the tests pass on your local system. Also make sure that Travis-CI, which runs these tests against Windows Server 2016, macOS 10.11 (El Capitan, 2015) and 11.3 (Big Sur, 2020), Ubuntu 14 (Trusty), and Ubuntu 18 (Bionic), for both Python 2.7 and 3.9, fully passes. You can check the Travis-CI status for Playsound here: https://travis-ci.com/github/TaylorSMarks/playsound/builds
This software is Copyright (c) 2021 Taylor Marks taylor@marksfam.com.
See the bundled LICENSE file for more information.
FAQs
Pure Python, cross platform, single function module with no dependencies for playing sounds.
We found that playsound demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.