Skip to content

Commit

Permalink
Undo smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
NodudeWasTaken committed Aug 25, 2024
1 parent da5db68 commit 0b6d98d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
5 changes: 4 additions & 1 deletion dancer/libfun.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
import matplotlib as mpl
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.figure import Figure
from audioread import audio_open

VERSION="?"
HEATMAP = LinearSegmentedColormap.from_list("intensity",["w", "g", "orange", "r"], N=256)

#TODO: Fix action lag that happens sometimes, maybe change hop?
def load_audio_data(audio_file, hop_length=1024, frame_length=1024, plp=True):
y, sr = librosa.load(audio_file, sr=None, mono=True)
y, sr=None,None
with audio_open(audio_file) as f:
y, sr = librosa.load(f, sr=None, mono=True)

# Compute beats
onset = None
Expand Down
17 changes: 2 additions & 15 deletions dancer/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,9 @@ def run(self):
self.pre()

if (isinstance(self.fileName, Path)):
audioFile = Path(cfg.get("temporary_folder", "tmp"), self.fileName.with_suffix(".wav").name)
audioFile.parent.mkdir(parents=True, exist_ok=True)

if (len(self.data) <= 0):
try:
ffmpeg_conv(self.fileName, audioFile)
except:
self.progressed(-1, "Failed to convert to wav!")
self.finished()
return

self.progressed(20, "Transforming audio data...")

try:
self.data = load_audio_data(audioFile, plp=self.plp)
except:
self.data = load_audio_data(self.fileName, plp=self.plp)
except Exception as e:
self.progressed(-1, "Failed to transform audio data!")
self.finished()
return
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy<1.24
librosa @ git+https://github.com/audioseek/librosa@main
librosa==0.10.0.post2
matplotlib<3.8
scipy==1.9.3
pyinstaller
Expand Down

0 comments on commit 0b6d98d

Please sign in to comment.