(self)
| 29 | self.opt_q = opt_q |
| 30 | |
| 31 | def run(self): |
| 32 | import numpy as np |
| 33 | import pyworld |
| 34 | |
| 35 | while 1: |
| 36 | idx, x, res_f0, n_cpu, ts = self.inp_q.get() |
| 37 | f0, t = pyworld.harvest( |
| 38 | x.astype(np.double), |
| 39 | fs=16000, |
| 40 | f0_ceil=1100, |
| 41 | f0_floor=50, |
| 42 | frame_period=10, |
| 43 | ) |
| 44 | res_f0[idx] = f0 |
| 45 | if len(res_f0.keys()) >= n_cpu: |
| 46 | self.opt_q.put(ts) |
| 47 | |
| 48 | |
| 49 | if __name__ == "__main__": |
no test coverage detected