just_playback
A small library for playing audio files in python. Provides file format independent methods for loading audio files, playing, pausing, resuming, stopping, seeking, getting the current playback position, and changing the volume.
The package uses miniaudio for awesome cross-platform, dependency-free asynchronous audio playback that stays away from your main thread.
Installation
pip install just_playback
Usage
from just_playback import Playback
playback = Playback() # creates an object for managing playback of a single audio file
playback.load_file('music-files/sample.mp3')
# or just pass the filename directly to the constructor
playback.play() # plays loaded audio file from the beginning
playback.pause() # pauses playback. Has no effect if playback is already paused
playback.resume() # resumes playback. Has no effect if playback is playing
playback.stop() # stops playback. Has no effect if playback is not active
playback.seek(60) # positions playback at 1 minute from the start of the audio file
playback.set_volume(0.5) # sets the playback volume to 50% of the audio file's original value
playback.loop_at_end(True) # since 0.1.5. Causes playback to automatically restart when it completes.
playback.active # True if playback is active i.e playing or paused
playback.curr_pos # current absolute playback position in seconds from
# the start of the audio file (unlike pygame.mixer.get_pos).
playback.paused # True if playback is paused.
playback.duration # length of the audio file in seconds.
playback.volume # current playback volume
playback.loops_at_end # True if playback is set to restart when it completes.
Metadata
Release files for just_playback 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| just_playback-0.1.6.tar.gz | 504.1 kB | Without provenance | Details |
Release files / just_playback-0.1.6.tar.gz
| Download URL | just_playback-0.1.6.tar.gz |
|---|---|
| Size | 504.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d03088f5a862ab48f1e64dbb69844b6a793bea51df9dc7fc6f9b9e27af35947d
|
|
BLAKE2b-256 checksum How to use checksums |
05f905c44d7d3fe30528e0fb14b9c15e9c2dc67f0ea96db9b5b58d9cbfabbabb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.1.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.9
|
Security for just_playback 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.