@@ -41,11 +41,11 @@ def wav2(i: BytesIO, o: BufferedWriter, format: str):
41
41
42
42
43
43
def load_audio (
44
- file : Union [str , BytesIO , Path ],
45
- sr : Optional [int ] = None ,
46
- format : Optional [str ] = None ,
47
- mono = True ,
48
- ) -> Union [np .ndarray , Tuple [np .ndarray , int ]]:
44
+ file : Union [str , BytesIO , Path ],
45
+ sr : Optional [int ] = None ,
46
+ format : Optional [str ] = None ,
47
+ mono = True ,
48
+ ) -> Union [np .ndarray , Tuple [np .ndarray , int ]]:
49
49
"""
50
50
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI/blob/412a9950a1e371a018c381d1bfb8579c4b0de329/infer/lib/audio.py#L39
51
51
"""
@@ -113,7 +113,7 @@ def frame_iter(container):
113
113
114
114
np .copyto (decoded_audio [..., offset :end_index ], frame_data )
115
115
offset += len (frame_data [0 ])
116
-
116
+
117
117
container .close ()
118
118
119
119
# Truncate the array to the actual size
@@ -124,4 +124,4 @@ def frame_iter(container):
124
124
125
125
if sr is not None :
126
126
return decoded_audio
127
- return decoded_audio , rate
127
+ return decoded_audio , rate
0 commit comments