Midnight Player is a modern python audio player. It provides functionalities like playlist management, playback speed adjustment, and a dark/light theme.
- Audio Playback: Supports various audio formats including MP3, WAV, FLAC, OGG, M4A, AAC, and WMA.
- Playlist Management: Create and manage playlists with ease.
- Playback Speed Control: Adjust playback speed between 0.5x and 2x.
- Dark and Light Themes: Choose between dark and light themes for an optimal UI experience.
- Cross-Platform: Available for Windows, Ubuntu (DEB) Linux distributions.
- Download the installer from the Releases section.
- Run the installer and follow the on-screen instructions.
- Download the
.deb
package from the Releases section. - Install it using the following commands:
sudo dpkg -i midnight-player_1.0-1_amd64.deb sudo apt-get install -f
- Ensure you have Python 3.7+ and pip installed.
- Clone the repository:
git clone https://github.com/Niamorro/Midnight-Player cd Midnight-Player
- Install the required packages:
pip install -r requirements.txt
- Run the application:
python main.py
- Launch the application.
- Use the
File
menu to open audio files or folders. - Create and manage playlists via the
Add Playlist
andRemove Playlist
options. - Control playback speed using the dropdown menu.
- Adjust the volume and navigate through tracks using the sliders.
-
File Selection:
The user selects an audio file from the File menu. Supported formats include MP3, WAV, FLAC, OGG, M4A, AAC, and WMA. -
FFmpeg Decoding:
The selected file is passed toffmpeg
via a subprocess to extract raw audio data. The command used:ffmpeg -v quiet -i <file_path> -f f32le -acodec pcm_f32le -ac 2 -ar <samplerate> -
-
Data Processing:
- Read Audio Data:
The audio data is read in blocks and stored as a NumPy array for efficient processing. - Apply Volume Adjustment:
The volume adjustment is applied by multiplying the audio array by a volume coefficient. - Playback Speed Adjustment:
The playback speed (e.g., 2x) is managed viasounddevice
by modifying the samplerate.
- Read Audio Data:
-
Playback:
- Output Stream:
The processed audio data is streamed to the audio output using thesounddevice
library. - Playback Controls:
Controls such as play/pause, next/previous track, and seek are handled via theAudioTrigger
class.
- Output Stream:
-
Play/Pause:
Uses theAudioTrigger
class to start/stop audio streaming. -
Next/Previous Track:
Updates the current track index and loads the next/previous track in the playlist. -
Seek:
Adjusts the playback position by recalculating the position index based on the slider value.
-
Track Queue Widget:
Displays the current playlist or folder contents. -
Playlist Widget:
Allows the user to add and remove playlists. -
Track Info Widget:
Shows metadata and artwork for the currently playing track.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the GPLv3 License. See the LICENSE file for details.