Skip to content

Commit

Permalink
fix(doc): save audio bug in the demo (#563)
Browse files Browse the repository at this point in the history
fix #561
  • Loading branch information
youralmight committed Jul 11, 2024
1 parent d089bd2 commit d1fc445
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ texts = ["PUT YOUR 1st TEXT HERE", "PUT YOUR 2nd TEXT HERE"]

wavs = chat.infer(texts)

torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)
for i in range(len(wavs)):
torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]).unsqueeze(0), 24000)
```

### Advanced Usage
Expand Down Expand Up @@ -200,7 +201,7 @@ wavs = chat.infer(

text = 'What is [uv_break]your favorite english food?[laugh][lbreak]'
wavs = chat.infer(text, skip_refine_text=True, params_refine_text=params_refine_text, params_infer_code=params_infer_code)
torchaudio.save("output2.wav", torch.from_numpy(wavs[0]), 24000)
torchaudio.save("word_level_output.wav", torch.from_numpy(wavs[0]).unsqueeze(0), 24000)
```

<details open>
Expand All @@ -221,7 +222,7 @@ params_refine_text = ChatTTS.Chat.RefineTextParams(
)

audio_array_en = chat.infer(inputs_en, params_refine_text=params_refine_text)
torchaudio.save("output3.wav", torch.from_numpy(audio_array_en[0]), 24000)
torchaudio.save("self_introduction_output.wav", torch.from_numpy(audio_array_en[0]), 24000)
```

<table>
Expand Down

0 comments on commit d1fc445

Please sign in to comment.