#!/usr/bin/python3 # -*- coding: utf-8 -*- import argparse from gradio_client import Client, handle_file import numpy as np from scipy.io import wavfile def get_args(): parser = argparse.ArgumentParser() parser.add_argument( "--filename1", default=r"E:\牛信文档\语音克隆\多语种语音克隆\voice\英语\English_1.wav", type=str, ) parser.add_argument( "--filename2", default=r"E:\牛信文档\语音克隆\多语种语音克隆\voice\英语\xtts_v2_english_2.wav", type=str, ) parser.add_argument( "--filename3", default=r"E:\牛信文档\语音克隆\多语种语音克隆\voice\英语\English_3.wav", type=str, ) args = parser.parse_args() return args def main(): args = get_args() client = Client("http://10.75.27.247:7861/") new_filename2, _ = client.predict( audio_t=handle_file(args.filename2), radio=1, decibel=0, reference=handle_file(args.filename3), engine="by_ffmpy_by_db", api_name="/when_click_change_volume" ) _, signal1 = wavfile.read(args.filename1) _, signal2 = wavfile.read(new_filename2) _, signal3 = wavfile.read(args.filename3) signal = np.concat([signal1, signal2, signal3], axis=0) print(signal.shape) return if __name__ == '__main__': main()