From 638fa9b1a981051de95508d92c360ab64afd7ee9 Mon Sep 17 00:00:00 2001 From: Ftps Date: Mon, 22 Jan 2024 14:22:09 +0900 Subject: [PATCH] add usage of lib inference --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index fec8d17..001c788 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,33 @@ Finally, specify the location of the model in the env file, and you are done! +### Library Usage + +#### Inference Audio +```python +from pathlib import Path + +from dotenv import load_dotenv +from scipy.io import wavfile + +from rvc.modules.vc.modules import VC + + +def main(): + vc = VC() + vc.get_vc("{model.pth}") + tgt_sr, audio_opt, times, _ = vc.vc_single( + 1, Path("{InputAudio}") + ) + wavfile.write("{OutputAudoi}", tgt_sr, audio_opt) + + +if __name__ == "__main__": + load_dotenv("envPath") + main() + +``` + ### CLI Usage #### Inference Audio