structural fix

This commit is contained in:
Mikkeli Matlock
2024-09-25 10:35:07 +09:00
parent d912229b9b
commit e213d8b014
+7
View File
@@ -25,6 +25,13 @@ def read_mp3_tags(file_path):
else: else:
print(f"File name: {os.path.basename(file_path)}") print(f"File name: {os.path.basename(file_path)}")
class AudioFile:
def __init__(self, file_path):
self.file_path = file_path
self.y, self.sr = librosa.load(file_path)
self.y_mono = librosa.to_mono(self.y)
def analyze_track_librosa(file_path): def analyze_track_librosa(file_path):
# Load the audio file # Load the audio file
# y is the audio time series and sr is the sampling rate # y is the audio time series and sr is the sampling rate