Skip to main content

Pure Python, cross platform, single function module with no dependencies for playing sounds.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

playsound-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file playsound-1.0.0.tar.gz.

File metadata

  • Download URL: playsound-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for playsound-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4cbd5f513e34b5b051382a07460f3d9d288b1fbee8af684ac9cbb59bf9ea69ca
MD5 352a758c8db8144a36e19fe5a5df2283
BLAKE2b-256 37aa62fa4247dab9221e503d0798c8fc5403c4a973eef0d1e0b2d2099a00d1f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page