mirror of
https://www.modelscope.cn/iic/speech_sambert-hifigan_tts_zh-cn_16k.git
synced 2026-04-03 02:42:54 +08:00
update
This commit is contained in:
@ -106,8 +106,6 @@ widgets:
|
||||
|
||||
#### 代码范例
|
||||
```Python
|
||||
from scipy.io.wavfile import write
|
||||
|
||||
from modelscope.outputs import OutputKeys
|
||||
from modelscope.pipelines import pipeline
|
||||
from modelscope.utils.constant import Tasks
|
||||
@ -116,8 +114,9 @@ text = '待合成文本'
|
||||
model_id = 'damo/speech_sambert-hifigan_tts_zh-cn_16k'
|
||||
sambert_hifigan_tts = pipeline(task=Tasks.text_to_speech, model=model_id)
|
||||
output = sambert_hifigan_tts(input=text)
|
||||
pcm = output[OutputKeys.OUTPUT_PCM]
|
||||
write('output.wav', 16000, pcm)
|
||||
wav = output[OutputKeys.OUTPUT_WAV]
|
||||
with open('output.wav', 'wb') as f:
|
||||
f.write(wav)
|
||||
```
|
||||
|
||||
### 模型局限性以及可能的偏差
|
||||
|
||||
Reference in New Issue
Block a user