Skip to content

Commit

Permalink
Starting to work on aligning audio
Browse files Browse the repository at this point in the history
  • Loading branch information
urinieto committed Oct 13, 2019
1 parent 72f8f6a commit 79b0dcf
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions notebooks/Audio Alignment.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Audio Alignment for Harmonix Set\n",
"\n",
"This notebook tries to align purchased audio with original audio from Harmonix. \n",
"\n",
"More specifically, for each pair of audio files:\n",
"- Load both audio files\n",
"- Use DTW to find the correct start and end points of alignment\n",
"- Produce the new aligned mp3s from the purchased audio"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import librosa\n",
"from librosa import display\n",
"\n",
"ORIG_MP3_PATH = \"/home/uri/Projects/\"\n",
"PURC_MP3_PATH = \"/home/uri/Dropbox/drop/HarmonixMP3_YouTube/\"\n",
"SR = 22050\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Load audio\n",
"_1, fs = librosa.load('audio/sir_duke_slow.mp3')\n",
"plt.figure(figsize=(16, 4))\n",
"librosa.display.waveplot(x_1, sr=fs)\n",
"plt.title('Slower Version $X_1$')\n",
"plt.tight_layout()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 79b0dcf

Please sign in to comment.