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

fix(config): dml load & av codec ctx has no base_rate attr

This commit is contained in:
源文雨
2025-11-21 15:48:03 +08:00
parent 71cc31a96c
commit 7fa122045f
2 changed files with 6 additions and 1 deletions

View File

@@ -195,7 +195,10 @@ def get_audio_properties(input_path: str) -> Tuple[int, int]:
container = av.open(input_path)
audio_stream = next(s for s in container.streams if s.type == "audio")
channels = 1 if audio_stream.layout == "mono" else 2
rate = audio_stream.base_rate
try:
rate = audio_stream.base_rate
except:
rate = audio_stream.sample_rate
container.close()
return channels, rate