Commit d4c1a404 authored by Robozman's avatar Robozman

Adopted libroseToWave

parent abc064a5
......@@ -10,6 +10,7 @@ import msaf
import librosa
import sys
import librosaToWave
import generate_waves
load_from_file = False
......@@ -30,8 +31,9 @@ else:
if load_from_file == False:
wav_data, rate = generate_waves.generate_waves(wave_type, 52)
elif load_from_file == True:
rate, wav_data = wavfile.read(sys.argv[1], mmap=True)
#rate, wav_data = wavfile.read(sys.argv[1], mmap=True)
# wav_data = samples
wav_data, rate = librosaToWave.getWave(fileName=sys.argv[1])
boundaries, labels = msaf.process(sys.argv[1])
audio = librosa.load(sys.argv[1], sr=None)[0]
audio_harmonic, audio_percussive = librosa.effects.hpss(audio)
......@@ -72,7 +74,7 @@ while t - origin < len(wav_data) / rate:
fft_plot.clear()
if load_from_file == True:
fft_plot.plot(np.abs(np.fft.fftshift(np.fft.fft(second[:,0]))))
fft_plot.plot(np.abs(np.fft.fftshift(np.fft.fft(second[:]))))
else:
fft_plot.plot(np.abs(np.fft.fftshift(np.fft.fft(second[:]))))
fig.canvas.draw()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment