@@ -213,8 +213,7 @@ def infer(
213
213
pitch , pitchf = self ._get_f0 (
214
214
input_wav [- f0_extractor_frame :],
215
215
self .f0_up_key - self .formant_shift ,
216
- 3 ,
217
- f0method ,
216
+ method = f0method ,
218
217
)
219
218
shift = block_frame_16k // self .window
220
219
self .cache_pitch [:- shift ] = self .cache_pitch [shift :].clone ()
@@ -297,7 +296,7 @@ def _get_f0_post(self, f0, f0_up_key):
297
296
def _get_f0_pm (self , x , f0_up_key , filter_radius ):
298
297
if not hasattr (self , "pm" ):
299
298
self .pm = PM (hop_length = 160 , sampling_rate = 16000 )
300
- f0 = self .pm .compute_f0 (x )
299
+ f0 = self .pm .compute_f0 (x . cpu (). numpy () )
301
300
return self ._get_f0_post (f0 , f0_up_key )
302
301
303
302
def _get_f0_harvest (self , x , f0_up_key , filter_radius = 3 ):
@@ -309,7 +308,7 @@ def _get_f0_harvest(self, x, f0_up_key, filter_radius=3):
309
308
self .sr ,
310
309
)
311
310
if filter_radius is None : filter_radius = 3
312
- f0 = self .harvest .compute_f0 (x , filter_radius = filter_radius )
311
+ f0 = self .harvest .compute_f0 (x . cpu (). numpy () , filter_radius = filter_radius )
313
312
return self ._get_f0_post (f0 , f0_up_key )
314
313
315
314
def _get_f0_dio (self , x , f0_up_key , filter_radius ):
@@ -320,7 +319,7 @@ def _get_f0_dio(self, x, f0_up_key, filter_radius):
320
319
self .f0_max ,
321
320
self .sr ,
322
321
)
323
- f0 = self .dio .compute_f0 (x )
322
+ f0 = self .dio .compute_f0 (x . cpu (). numpy () )
324
323
return self ._get_f0_post (f0 , f0_up_key )
325
324
326
325
def _get_f0_crepe (self , x , f0_up_key , filter_radius ):
0 commit comments