def mag2spec_and_audio(xhat, MSphase, arguments):
MSphase = MSphase.cpu().numpy()
Nmix = MSphase.shape[0]
mags = np.split(xhat, Nmix, axis=0)
phases = np.split(MSphase, Nmix, axis=0)
all_audio = []
for mag, phase in zip(mags, phases):
all_audio.append(lr.istft((mag*np.exp(1j*phase.squeeze())).transpose(),
win_length=arguments.win_length))
return all_audio, mags
评论列表
文章目录