[to #41669377] fix pipeline output wav is 32-bit float expect 16-bit int

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11765670
This commit is contained in:
jiaqi.sjq
2023-02-24 11:00:40 +08:00
committed by wenmeng.zwm
parent f19bbdd7ea
commit e76480482e

View File

@@ -218,5 +218,6 @@ class SambertHifigan(Model):
for line in texts:
line = line.strip().split('\t')
audio = self.__synthesis_one_sentences(voice, line[1])
audio_total = np.append(audio_total, audio, axis=0)
audio = 32768.0 * audio
audio_total = np.append(audio_total, audio.astype('int16'), axis=0)
return ndarray_pcm_to_wav(self.__sample_rate, audio_total)