Python3 library for the DFPlayer-mini
Project description
DFPlayer
Python3 library for the DFPlayer Mini MP3 Module, works with USB to TTL.
Installation
pip install DFPlayer
Usage
from DFPlayer import DFPlayer
serial_device = '/dev/ttyUSB0' # on Windows OS use COMX, example 'COM5'
df = DFPlayer(serial_device)
df.num_files() # get number of files on the SD card
df.play(1) # play a song by a specific number of files, without argument play the first song
df.random() # play random song
df.next() # play next song
df.previous() # play previous song
df.pause() # pause played song
df.stop() # stop played song
df.loop() # loop current played song
df.loop_all() # loop all songs on the SD card
df.set_volume(60) # set volume to 60%, default is 50
df.get_volume() # get current audio volume
df.set_eq(DFPlayer.EQ_NORMAL) # set equalizer to (EQ_NORMAL, EQ_POP, EQ_ROCK, EQ_JAZZ, EQ_CLASSIC, EQ_BASS), default is EQ_NORMAL
df.get_eq() # get current equalizer
df.reset() # reset the module
Test
Make sure the module has an SD card installed and has a minimum of three songs inside. Connect with USB to TTL.
pip install -r requirements.txt
python3 -m unittest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dfplayer-0.1.2.tar.gz
(5.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dfplayer-0.1.2.tar.gz.
File metadata
- Download URL: dfplayer-0.1.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03991c1f4941afdc8ec08bbe9dad8db382ae6a30e772c99290faf4b4db60cc7c
|
|
| MD5 |
8fff322ed2ca457f2318c4c8b6d9d6f6
|
|
| BLAKE2b-256 |
440d0d3d5b6bf4d979bef14a33db249da09471aeadfa6e1a027147f303be041b
|
File details
Details for the file DFPlayer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: DFPlayer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa17f5a4be4ebd57788a395d2f893f570277a3652277146ea670e3b7b0dcdc1d
|
|
| MD5 |
d88f068fde4236191f7722cc58dd3e34
|
|
| BLAKE2b-256 |
90ba8ae70304d0334e24e4ffb96625cd47630c9ad785d9384438bd37b8e75792
|