Skip to content

一个基于 PyQt5 的音频播放器项目,采用了 MVC 框架。该项目在 Ubuntu 20.04 下进行开发,可指定播放特定文件夹下的歌曲及顺序播放、单曲循环、随机播放等基本功能。此外,还实现了倍速播放功能。

Notifications You must be signed in to change notification settings

yuan2001425/yuanMusic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YuanGeTingLe - Audio Player

You can also read a translated version of this file in Chinese 简体中文版.

This is an audio player project based on PyQt5 and follows the MVC framework. The project was developed on Ubuntu 20.04 and supports playing songs in a specific folder, sequential playback, single-song loop, random playback, and other basic functions. Additionally, it implements the feature of variable playback speed.

Environment Setup

Use the following commands to create the virtual environment required for the project:

conda env create -f environment.yml
conda activate yuanMusic

Run the Project

1. Prepare Audio Files

You can choose to create an empty music folder and add audio files yourself:

mkdir music

Alternatively, unzip the provided sample music (popular songs by Eason Chan):

Link: https://pan.baidu.com/s/1EG0QBhtZ_KfbkuHmxejUeA?pwd=i9pz

Extraction Code: i9pz

--Shared from Baidu Cloud Super Member V5

unzip music.zip

2. Configure Audio File Types (Optional)

Open the src/controller/controller.py file.

Modify the ALLOW_VOICE_TYPE variable to allow playing other file types. The default is:

ALLOW_VOICE_TYPE = [".mp3", ".wav"]

3. Launch the Audio Player

Run the following command in the terminal to start the audio player:

python main.py

Features

  • Specify Folder for Playback: Choose a specific folder to play songs only from that folder.
  • Playback Modes: Support sequential playback, single-song loop, and random playback.
  • Variable Playback Speed: Provide options for variable playback speed to accelerate or decelerate audio playback.

Usage Instructions

  1. Launch the Application:

    • After opening the application, use the controls on the interface to select the playback mode and target folder.
    • The system will automatically detect playable audio files in the directory and display them in the list.
    • By default, the system will automatically play the first song in the playlist.
  2. Audio Playback Control:

    • Click the play button to play and pause audio.
    • Adjust the audio playback progress easily by dragging the slider.
  3. Audio Switching and Adjustment:

    • Use the previous and next buttons or double-click on a song in the list to switch audio conveniently.
    • Adjust loop mode and playback speed to meet personalized preferences.
  4. Exit the Application:

    • To exit the application, simply click the close button in the upper right corner of the window.

Directory Structure

  • doc: Related documents
  • music: Sample music directory
  • src: Source code
    • controller: Control logic
      • controller.py
    • model: Audio model
      • model.py
    • view: Display interface
      • UI: UI interface generated by QtDesigner
        • Widget.py
        • Widget.ui
      • view.py: Personalized frontend
  • environment.yml: Dependency installation
  • main.py: Function entry point
  • README_CN.md: Chinese project introduction
  • README.md: English project introduction

Notes

  • Make sure Python 3.10 or above is installed.
  • Before running the application, ensure that the environment is configured and the virtual environment is activated.

Version Information

  • Python Version: 3.10
  • PyQt Version: 5.15

Author Information

Author: YuanGeTingLe (CSDN/Bilibili/GitHub/WeChat Official Account with the same name)

For any questions or suggestions, please contact the author: yuan2001425@163.com

About

一个基于 PyQt5 的音频播放器项目,采用了 MVC 框架。该项目在 Ubuntu 20.04 下进行开发,可指定播放特定文件夹下的歌曲及顺序播放、单曲循环、随机播放等基本功能。此外,还实现了倍速播放功能。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages