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

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

mp3.play()

import time
time.sleep(min(30, mp3.seconds()))
mp3.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.9.zip (7.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Source

mp3play-0.1.9-py2.4.egg (3.5 kB view details)

Uploaded Source

File details

Details for the file mp3play-0.1.9.zip.

File metadata

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

File hashes

Hashes for mp3play-0.1.9.zip
Algorithm Hash digest
SHA256 88a5dc1557168ca3a4f473059808d3b53adb446d9b2a2329b5dd3fb8d0d4787c
MD5 2f41be66faf12e7498794ec1b392a092
BLAKE2b-256 13143f4a324996b93544f175d327b3109421bab50767a39c6d73db58949436e1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mp3play-0.1.9-py2.5.egg
Algorithm Hash digest
SHA256 e51f369be8ca819ddd25a7f57123cc78fc2e70e8989f7bc831063b2124ef5164
MD5 4e56b594741a368d236d516320234a95
BLAKE2b-256 625a414799595f72af51bc3c567e6cec5605e100b067f56df6b1093698593e43

See more details on using hashes here.

File details

Details for the file mp3play-0.1.9-py2.4.egg.

File metadata

  • Download URL: mp3play-0.1.9-py2.4.egg
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mp3play-0.1.9-py2.4.egg
Algorithm Hash digest
SHA256 1cb0b49441839ac7249e48207798992fe668a0446a105eef92549850a26bc6f6
MD5 fc209a472364450e814263607a243a8b
BLAKE2b-256 861181e33b154b4716cd922a130189bcd768e4e8920b8b0bd93849168b5d6d5d

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