mirror of
https://github.com/aigc3d/LAM_Audio2Expression.git
synced 2026-02-04 09:29:24 +08:00
Fix frame_length too short bug.
This commit is contained in:
committed by
GitHub
parent
c29a6f38f8
commit
45451ca6d2
@@ -168,7 +168,7 @@ class Audio2ExpressionInfer(InferBase):
|
||||
frame_length = math.ceil(audio.shape[0] / ssr * 30)
|
||||
output_context = DEFAULT_CONTEXT.copy()
|
||||
|
||||
volume = librosa.feature.rms(y=audio, frame_length=int(1 / 30 * ssr), hop_length=int(1 / 30 * ssr))[0]
|
||||
volume = librosa.feature.rms(y=audio, frame_length=min(int(1 / 30 * ssr), len(audio)), hop_length=int(1 / 30 * ssr))[0]
|
||||
if (volume.shape[0] > frame_length):
|
||||
volume = volume[:frame_length]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user