separate music and voice, to sing song from our side.

 # Step 1: Install dependencies

!pip install -q yt-dlp spleeter
!apt-get -qq install ffmpeg
#-----------


# Step 2: Set the YouTube video URL (with full vocals+music)
youtube_url = "https://www.youtube.com/watch?v=pPqt5_NBoLw"

# Step 3: Download audio (MP3)
import yt_dlp
import os

output_path = "/content/song.%(ext)s"

ydl_opts = {
    'format': 'bestaudio/best',
    'outtmpl': output_path,
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}

with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    ydl.download([youtube_url])

# Step 4: Use Spleeter to split audio into vocals and accompaniment
!mkdir -p /content/output
!spleeter separate -p spleeter:2stems -o /content/output /content/song.mp3

Popular posts from this blog

SAP CPI : camle expression in sap cpi , cm, router, filter and groovy script. format

pss book: గురు ప్రార్థనామంజరి . completed 21st july 2024

pss book : శ్రీకృష్ణుడు దేవుడా, భగవంతుడా completed , second review needed. 26th April 2024