Advanced-RVC-Inference / testhandler.py
smjain's picture
Upload testhandler.py
0d425b8 verified
import torch
import os
import traceback
import sys
import warnings
import shutil
import numpy as np
import infer_new
def main():
try:
print("Inside main function ********")
# Setup your parameters here
spk_id = "modi.pth"
voice_transform = 0
input_audio_path = "test.mp3"
# Call the api_convert_voice function from infer_new.py
# Ensure that infer_new.py is correctly implemented to handle this function call
output_path = infer_new.api_convert_voice(spk_id, voice_transform, input_audio_path)
print(f"Processed audio file is located at: {output_path}")
# Depending on your needs, you can return or print any results here
print(f"Hello, ! The processed audio file is located at: {output_path}")
except Exception as e:
print("An error occurred:", e)
traceback.print_exc()
if __name__ == "__main__":
main()