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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user