{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Lyrics-audio Alignment"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"audio_name = \"Kinematic_-_Peyote\"\n",
"lyrics = f\"dataset/jamendolyrics/lyrics/{audio_name}.raw.txt\"\n",
"audio = f\"dataset/jamendolyrics/mp3/{audio_name}.mp3\"\n",
"lang = \"en-US\"\n",
"blank_id = 0"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import torch\n",
"torch.cuda.is_available()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" "
],
"text/plain": [
""
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.lib.display import Audio\n",
"from lsync.config import ORIGINAL_SR\n",
"\n",
"def show_audio(audio, sr):\n",
" return Audio(audio, rate=sr, autoplay=False)\n",
"\n",
"show_audio(audio, ORIGINAL_SR)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Vocals Extraction"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"from lsync.voice_extractor import VoiceExtractor\n",
"\n",
"ve = VoiceExtractor()\n",
"vocals = ve.extract_voice(audio, post_process=False)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Extracted Vocals"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"