Skip to main content

A simple interface for playing music from an MP3 file.

Project description

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!

Resources

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

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

mp3play-0.1.11.zip (9.9 kB view details)

Uploaded Source

Built Distribution

mp3play-0.1.11-py2.5.egg (6.3 kB view details)

Uploaded Source

File details

Details for the file mp3play-0.1.11.zip.

File metadata

  • Download URL: mp3play-0.1.11.zip
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mp3play-0.1.11.zip
Algorithm Hash digest
SHA256 f45b11739ae922154013ec203adf66687e80b3ba55e676d608d30c11707b2c1a
MD5 3a268d5b4e5d0c1a14c43a86eefcdfc7
BLAKE2b-256 3013da49eb9502f3dd46d295dd554771fa9cc24b80c9eb8d259dae17a5faf4f1

See more details on using hashes here.

File details

Details for the file mp3play-0.1.11-py2.5.egg.

File metadata

  • Download URL: mp3play-0.1.11-py2.5.egg
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mp3play-0.1.11-py2.5.egg
Algorithm Hash digest
SHA256 47701ad55313598823f8b09de50af7c992b8e85f97cb49199eadfc69360568c5
MD5 85a38f7c13340a5831ca2ae5ab4889ef
BLAKE2b-256 cea4f4ac12f498af293586cf6ab6df10ad0f0a2374da5158c4f4a7e89736e8c6

See more details on using hashes here.

Supported by

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