add usage of lib inference

This commit is contained in:
Ftps
2024-01-22 14:22:09 +09:00
parent 1759104a04
commit 638fa9b1a9

View File

@@ -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