1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 17:20:25 +08:00

fix(audio): use np.frombuffer() instead of direct conversion of the resampled frames

this fixes traceback on preprocessing
This commit is contained in:
Alex Murkoff
2024-06-11 16:03:03 +07:00
parent fd2f274494
commit 68a3d8caf2

View File

@@ -53,7 +53,7 @@ def load_audio(file: str, sr: int) -> np.ndarray:
except Exception as e:
raise RuntimeError(f"Failed to load audio: {e}")
return audio.flatten()
return np.frombuffer(audio, dtype=np.float32).flatten()
def downsample_audio(input_path: str, output_path: str, format: str) -> None:
if not os.path.exists(input_path): return