mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-10 21:56:34 +03:00
made volume more precise
This commit is contained in:
parent
5e0fafd3b7
commit
5088ab308a
|
@ -65,7 +65,7 @@ def process_mp3_file(path: str, user_id: int) -> None:
|
||||||
|
|
||||||
def analyze_music_loudness(mp3_file):
|
def analyze_music_loudness(mp3_file):
|
||||||
y, sr = librosa.load(mp3_file, sr=None)
|
y, sr = librosa.load(mp3_file, sr=None)
|
||||||
frame_length = int(0.5 * sr)
|
frame_length = int(0.1 * sr)
|
||||||
stft = np.abs(librosa.stft(y, n_fft=frame_length, hop_length=frame_length))
|
stft = np.abs(librosa.stft(y, n_fft=frame_length, hop_length=frame_length))
|
||||||
rms_energy = librosa.feature.rms(
|
rms_energy = librosa.feature.rms(
|
||||||
S=stft, frame_length=frame_length, hop_length=frame_length
|
S=stft, frame_length=frame_length, hop_length=frame_length
|
||||||
|
|
Loading…
Reference in New Issue
Block a user