Skip to content

Instantly share code, notes, and snippets.

@fredyjl
Created May 28, 2018 05:56
Show Gist options
  • Save fredyjl/3c395688ce149a3b6175ca1031f046ec to your computer and use it in GitHub Desktop.
Save fredyjl/3c395688ce149a3b6175ca1031f046ec to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import librosa\n",
"import librosa.display\n",
"\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"plt.rcParams['figure.figsize'] = (13, 5)\n",
"from IPython.display import display, Audio"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# we use your/path/to/Rumba-Misc/Media-103511.wav as the example;\n",
"# change '/home/yjluo/dataset/' to your path to BallroomData\n",
"path_audio = '/home/yjluo/dataset/BallroomData/Rumba-Misc/Media-103511.wav'"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# set some parameters \n",
"n_fft = 2048 # the FFT length\n",
"hop_len = 256 # the hop size for FFT\n",
"\n",
"x, sr = librosa.load(path_audio) # load the audio using librosa.load()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <audio controls=\"controls\" >\n",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment