mirror of
https://github.com/neodyland/sbv2-api.git
synced 2025-12-26 00:59:58 +00:00
21 lines
574 B
Python
21 lines
574 B
Python
from sbv2_bindings import TTSModel
|
|
|
|
|
|
def main():
|
|
with open("../models/debert.onnx", "rb") as f:
|
|
bert = f.read()
|
|
with open("../models/tokenizer.json", "rb") as f:
|
|
tokenizer = f.read()
|
|
|
|
model = TTSModel(bert, tokenizer)
|
|
|
|
with open("../models/amitaro.sbv2", "rb") as f:
|
|
model.load_sbv2file(f.read())
|
|
|
|
style_vector = model.get_style_vector("amitaro", 0, 1.0)
|
|
with open("output.wav", "wb") as f:
|
|
f.write(model.synthesize("こんにちは", "amitaro", style_vector, 0.0, 0.5))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |