Prototype of RVC+classification pipeline

This commit is contained in:
Tony Ribeiro 2023-08-18 01:12:00 +02:00
parent 16f3949e0b
commit 345505b534
2 changed files with 6 additions and 5 deletions

View File

@ -323,7 +323,7 @@ async function get_models_list(model_id) {
/*
Send an audio file to RVC to convert voice
*/
async function rvcVoiceConversion(response, character) {
async function rvcVoiceConversion(response, character, text) {
let apiResult
// Check voice map
@ -341,8 +341,6 @@ async function rvcVoiceConversion(response, character) {
const voice_settings = extension_settings.rvc.voiceMap[character];
console.log("Sending tts audio data to RVC on extras server")
var requestData = new FormData();
requestData.append('AudioFile', audioData, 'record');
requestData.append("json", JSON.stringify({
@ -352,9 +350,12 @@ async function rvcVoiceConversion(response, character) {
"indexRate": voice_settings["indexRate"],
"filterRadius": voice_settings["filterRadius"],
"rmsMixRate": voice_settings["rmsMixRate"],
"protect": voice_settings["protect"]
"protect": voice_settings["protect"],
"text": text
}));
console.log("Sending tts audio data to RVC on extras server",requestData)
const url = new URL(getApiUrl());
url.pathname = '/api/voice-conversion/rvc/process-audio';

View File

@ -412,7 +412,7 @@ async function tts(text, voiceId, char) {
// RVC injection
if (extension_settings.rvc.enabled)
response = await rvcVoiceConversion(response, char)
response = await rvcVoiceConversion(response, char, text)
addAudioJob(response)
completeTtsJob()