刘悦 commited on
Commit
866207d
1 Parent(s): cf43100

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -2
README.md CHANGED
@@ -80,7 +80,7 @@ export PYTHONPATH=third_party/Matcha-TTS
80
 
81
  ``` python
82
  from cosyvoice.cli.cosyvoice import CosyVoice
83
- from cosyvoice.utils.file_utils import load_wav
84
  import torchaudio
85
 
86
  cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M-SFT')
@@ -89,6 +89,10 @@ print(cosyvoice.list_avaliable_spks())
89
  output = cosyvoice.inference_sft('你好,我是通义生成式语音大模型,请问有什么可以帮您的吗?', '中文女')
90
  torchaudio.save('sft.wav', output['tts_speech'], 22050)
91
 
 
 
 
 
92
  cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M')
93
  # zero_shot usage, <|zh|><|en|><|jp|><|yue|><|ko|> for Chinese/English/Japanese/Cantonese/Korean
94
  prompt_speech_16k = load_wav('zero_shot_prompt.wav', 16000)
@@ -156,4 +160,4 @@ You can also scan the QR code to join our official Dingding chat group.
156
  5. We borrowed a lot of code from [WeNet](https://github.com/wenet-e2e/wenet).
157
 
158
  ## Disclaimer
159
- The content provided above is for academic purposes only and is intended to demonstrate technical capabilities. Some examples are sourced from the internet. If any content infringes on your rights, please contact us to request its removal.
 
80
 
81
  ``` python
82
  from cosyvoice.cli.cosyvoice import CosyVoice
83
+ from cosyvoice.utils.file_utils import load_wav,speed_change
84
  import torchaudio
85
 
86
  cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M-SFT')
 
89
  output = cosyvoice.inference_sft('你好,我是通义生成式语音大模型,请问有什么可以帮您的吗?', '中文女')
90
  torchaudio.save('sft.wav', output['tts_speech'], 22050)
91
 
92
+ # if you wanna change the speed
93
+ audio,sample_rate = speed_change(output["tts_speech"],22050,"1.6")
94
+ torchaudio.save('sft_speed_1.6.wav',audio, 22050)
95
+
96
  cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M')
97
  # zero_shot usage, <|zh|><|en|><|jp|><|yue|><|ko|> for Chinese/English/Japanese/Cantonese/Korean
98
  prompt_speech_16k = load_wav('zero_shot_prompt.wav', 16000)
 
160
  5. We borrowed a lot of code from [WeNet](https://github.com/wenet-e2e/wenet).
161
 
162
  ## Disclaimer
163
+ The content provided above is for academic purposes only and is intended to demonstrate technical capabilities. Some examples are sourced from the internet. If any content infringes on your rights, please contact us to request its removal.