In [ ]:
import torchaudio
import pydub
import librosa
import librosa.display
from IPython.display import FileLink, FileLinks
import IPython.display as ipd
%matplotlib notebook
In [ ]:
path = os.path.abspath('/home/justin/rsync_dl_rig/mp3s/Kaskade - Santa Baby ft. Jane.mp3')
In [ ]:
ipd.Audio(filename=path, autoplay=True)
In [ ]:
data, sampling_rate = librosa.load(path, sr=44100, mono=False)
In [ ]:
plt.figure(figsize=(12, 4))
librosa.display.waveplot(data, sr=sampling_rate)
In [ ]:
data.shape
In [ ]:
sampling_rate
In [ ]:
ipd.Audio(data, rate=sampling_rate, autoplay=True)
In [ ]:
librosa.output.write_wav('foo.wav', data, sampling_rate)
In [ ]:
librosa.output.write_wav('foo.wav', data, sampling_rate)
In [ ]:
!sox -r 44100 -c 2 foo.wav foo.mp3
In [ ]:
ipd.Audio('foo.mp3', autoplay=True)
In [ ]: