GithubHelp home page GithubHelp logo

tutorexilius / playsound Goto Github PK

View Code? Open in Web Editor NEW

This project forked from taylorsmarks/playsound

0.0 1.0 0.0 12 KB

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

License: MIT License

Python 100.00%

playsound's Introduction

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.

The latest version of the source code can be found at: https://github.com/TaylorSMarks/playsound

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.mp3') 

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. 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. Support for the block argument is currently not implemented.

Requirements

I've only tested playsound it with Python 2.7 on Windows 7 and OS X 10.11, but I expect that it should work on Windows XP thru 10 at least, OS X 10.5 and newer, all versions of Linux, and Python 2.3 and newer.

This software is Copyright (c) 2016 Taylor Marks <[email protected]>.

See the bundled LICENSE file for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.