Coder Social home page Coder Social logo

mrdodgerx / mp3lyricdownloader Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 78 KB

This Python application allows you to recognize music, search for lyrics, and download MP3 files. It continuously records audio, recognizes the song, searches for lyrics, and downloads the MP3 file.

Home Page: https://mrdodgerx.com

License: MIT License

Python 100.00%
lyrics-finder lyrics-search mp3 mp3downloader python systemd youtube

mp3lyricdownloader's Introduction

Music Recognition and Download Application

This Python application allows you to recognize music, search for lyrics, and download MP3 files. It continuously records audio, recognizes the song, searches for lyrics, and downloads the MP3 file.

Music Recognition

Features

  • Music Recognition: Automatically identifies the song being played.
  • Lyrics Search: Searches for the lyrics of the recognized song.
  • MP3 Download: Downloads the MP3 file of the recognized song.
  • Continuous Operation: Continuously monitors for music and performs the above tasks when a song is detected.

How it Works

  1. The application continuously records audio using the microphone.
  2. When music is detected, it recognizes the song being played using SongRec.
  3. It then searches for the lyrics of the recognized song using Google.
  4. Finally, it downloads the MP3 file of the recognized song from YouTube.

Requirements

  • Python 3.x
  • pip (Python package installer)
  • Dependencies listed in requirements.txt
  • SongRec: Install from GitHub

Installation

  1. Clone the repository:

    git clone https://github.com/mrdodgerx/mp3LyricDownloader.git
    cd mp3LyricDownloader
  2. Install dependencies:

    pip install -r requirements.txt
  3. Install SongRec: Read SongRec to install

  4. Create env.ini:

    [RECORDING]
    FS = 44100
    SECONDS = 10
    CHANNELS = 2
    WAV_OUTPUT = /tmp/output.wav
    
    [OUTPUT]
    LYRICS = /path/to/lyrics/output
    MP3 = /path/to/mp3/output

Usage

Run the main.py script:

python main.py

Make as Service

To create a service file for your Python application, you can follow these steps:

  1. Create a service file for systemd.
  2. Place it in the /etc/systemd/system/ directory.
  3. Enable the service to start on boot.

Here's how you can create the service file:

# /etc/systemd/system/music_recognition.service

[Unit]
Description=Music Recognition and Download Service
After=network.target

[Service]
User=your_username
WorkingDirectory=/path/to/your/application
Environment="PATH=/path/to/your/application/venv/bin"
ExecStart=sh /path/to/your/application/runserver.sh
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Replace your_username with your username and /path/to/your/application with the actual path to your application.

Then, enable and start the service:

sudo systemctl enable music_recognition.service
sudo systemctl start music_recognition.service

You can check the status of the service using:

sudo systemctl status music_recognition.service

This service will now start your Python application on boot.

Project Structure

  • main.py:

    • Main script to run the application
  • modules/

    • google.py: Handles Google search for lyrics
    • youtube.py: Handles YouTube search and MP3 download
  • env.ini: Configuration file

  • requirements.txt: List of dependencies

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

mp3lyricdownloader's People

Contributors

mrdodgerx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

mp3lyricdownloader's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.