展开
收起
游客taeheo5yiccxi2024-04-22 17:50:391071
from modelscope.outputs import OutputKeysfrom modelscope.pipelines import pipelinefrom modelscope.utils.constant import Taskstext = '待合成文本'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, voice='zhitian_emo')wav = output[OutputKeys.OUTPUT_WAV]with open('output.wav', 'wb') as f: f.write(wav)运行代码时,发现断网情况下无法正常使用
展开
收起
游客taeheo5yiccxi2024-04-22 17:50:391071