Update README.md
Browse files
README.md
CHANGED
@@ -31,6 +31,24 @@ From initial observations it seems like its better to use majority of one kind (
|
|
31 |
|
32 |
Trying to push the boundaries of audio generated by a mere 63 MB model.
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
## 🙏 Acknowledgements
|
35 |
|
36 |
[Bryce Beattie](https://brycebeattie.com/files/tts/) for training the Kristin model.
|
|
|
31 |
|
32 |
Trying to push the boundaries of audio generated by a mere 63 MB model.
|
33 |
|
34 |
+
## Inference
|
35 |
+
|
36 |
+
```python
|
37 |
+
import wave
|
38 |
+
|
39 |
+
from src.python_run.piper import PiperVoice # Or import from the installed package if you used pip
|
40 |
+
|
41 |
+
model = PiperVoice.load("en_US-ceylia-medium.onnx")
|
42 |
+
|
43 |
+
text = "I have a big plan for today. It involves fine-tuning you."
|
44 |
+
|
45 |
+
with wave.open("output.wav", "wb") as output_file:
|
46 |
+
output_file.setnchannels(1)
|
47 |
+
output_file.setsampwidth(2)
|
48 |
+
output_file.setframerate(22050)
|
49 |
+
model.synthesize(text=text, wav_file=output_file, sentence_silence=0.25)
|
50 |
+
```
|
51 |
+
|
52 |
## 🙏 Acknowledgements
|
53 |
|
54 |
[Bryce Beattie](https://brycebeattie.com/files/tts/) for training the Kristin model.
|