Skip to content

Commit

Permalink
[Example] ChatTTS: add demo wav
Browse files Browse the repository at this point in the history
  • Loading branch information
grorge123 committed Jul 18, 2024
1 parent 8e7c7d2 commit de03b76
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions wasmedge-chatTTS/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
asset
config
*.wav
config
10 changes: 9 additions & 1 deletion wasmedge-chatTTS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,12 @@ let config_data = serde_json::to_string(&json!({"prompt": "[oral_2][laugh_0][bre
.unwrap()
.as_bytes()
.to_vec();
```
```
### Demo speaker
<table>
<td align="center">

[demo](https://github.com/user-attachments/assets/53b6b5f0-8568-4309-9a91-735459156b07)

</td>
</table>
Binary file added wasmedge-chatTTS/assets/demo.mp4
Binary file not shown.
Binary file added wasmedge-chatTTS/assets/demo.wav
Binary file not shown.
3 changes: 1 addition & 2 deletions wasmedge-chatTTS/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn get_data_from_context(context: &GraphExecutionContext, index: usize, limit: u
}

fn main() {
let prompt = "It is [uv_break] test sentence [laugh] for chat T T S";
let prompt = "It is test sentence [uv_break] for chat T T S.";
let tensor_data = prompt.as_bytes().to_vec();
let config_data = serde_json::to_string(&json!({"prompt": "[oral_2][laugh_0][break_6]", "spk_emb": "random", "temperature": 0.5, "top_k": 0, "top_p": 0.9}))
.unwrap()
Expand All @@ -37,7 +37,6 @@ fn main() {
context.compute().expect("Failed to compute");
let bytes_written = get_data_from_context(&context, 1, 4);
let bytes_written = usize::from_le_bytes(bytes_written.as_slice().try_into().unwrap());
println!("Byte: {}", bytes_written);
let output_bytes = get_data_from_context(&context, 0, bytes_written);
let spec = hound::WavSpec {
channels: 1,
Expand Down

0 comments on commit de03b76

Please sign in to comment.