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