add player script and fix bug

This commit is contained in:
k
2025-11-12 12:11:57 -05:00
parent 64e66260ec
commit 579b37cd70
3 changed files with 58 additions and 3 deletions

10
data.py
View File

@@ -6,7 +6,15 @@ import mlflow
SAMPLE_RATE = 22050
#@mlflow.trace
def spec_to_audio(spec):
"""
Convert a normalized mel-spectrogram back to audio.
"""
spec = (spec * 80) - 80
spec = librosa.db_to_amplitude(spec)*80
audio = librosa.feature.inverse.mel_to_audio(spec,sr=SAMPLE_RATE)
return audio
def process_file(file_path):
"""
Load 10 second chunks single song.