Skip to main content

Allows your Windows Python program to play and stop MP3s, without opening an external player or requiring any external programs. A very simple interface for the common case (playing an entire MP3), with an API for more complex tasks (e.g. playing from seconds 30 to 45 of an MP3).

Note: if you are looking for complex cross-platform audio control, try pyglet. After easy_installing pyglet, it requires a separate manual installation of AVlib libraries, which is why I wrote mp3play as an easy_installable alternative.

Example

Play the first 30 seconds of a file:

import mp3play

filename = r'C:\Documents and Settings\Michael\Desktop\music.mp3'
clip = mp3play.load(filename)

clip.play()

import time
time.sleep(min(30, clip.seconds()))
clip.stop()

Requirements

Requires Windows XP at the moment, but the goal is to make a cross-platform module. Feel free to send patches to add Linux and Mac support! Note that the module’s purpose is to be easy_installable with no other work needed by the user, so things like AVLib are out unless that can be easy_installed automatically alongside mp3play.

Resources

Please let me know if you like or use this module - it would make my day!

Release files for mp3play 0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mp3play 0.1.15
File Size Uploaded
mp3play-0.1.15.zip 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mp3play 0.1.15
File Interpreter ABI Platform
mp3play-0.1.15-py2.5.egg Legacy Egg format - - Details

Total release size: 17.1 kB

Release files / mp3play-0.1.15.zip

Download URL mp3play-0.1.15.zip
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
73fc852f3ca240a74fe068d2f190574907acbdb7ccf54a5a8bcd73d4ef7eb65b
BLAKE2b-256 checksum
How to use checksums
44b1a2c0bd83fc01f45494957419f5b4cbaa063686d3ef6dc29cdccbc4453482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / mp3play-0.1.15-py2.5.egg

Download URL mp3play-0.1.15-py2.5.egg
Size 6.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
53f570dda8824e16f0cbdc1a1b356e9154e5688804390fb9b60553e8e4ccbffd
BLAKE2b-256 checksum
How to use checksums
76e22e988a7fc1fca5917fbed1082d8a3b0df0f7415bf60bbec29f1c3a89d368
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.15 This release

2 release files

0.1.11

2 release files

0.1.10

3 release files

0.1.9

3 release files

0.1.7

3 release files

0.1.6

3 release files

0.1.5

3 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

3 release files

0.1.1

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page