mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Prototype of RVC+classification pipeline
This commit is contained in:
@ -323,7 +323,7 @@ async function get_models_list(model_id) {
|
|||||||
/*
|
/*
|
||||||
Send an audio file to RVC to convert voice
|
Send an audio file to RVC to convert voice
|
||||||
*/
|
*/
|
||||||
async function rvcVoiceConversion(response, character) {
|
async function rvcVoiceConversion(response, character, text) {
|
||||||
let apiResult
|
let apiResult
|
||||||
|
|
||||||
// Check voice map
|
// Check voice map
|
||||||
@ -341,8 +341,6 @@ async function rvcVoiceConversion(response, character) {
|
|||||||
|
|
||||||
const voice_settings = extension_settings.rvc.voiceMap[character];
|
const voice_settings = extension_settings.rvc.voiceMap[character];
|
||||||
|
|
||||||
console.log("Sending tts audio data to RVC on extras server")
|
|
||||||
|
|
||||||
var requestData = new FormData();
|
var requestData = new FormData();
|
||||||
requestData.append('AudioFile', audioData, 'record');
|
requestData.append('AudioFile', audioData, 'record');
|
||||||
requestData.append("json", JSON.stringify({
|
requestData.append("json", JSON.stringify({
|
||||||
@ -352,9 +350,12 @@ async function rvcVoiceConversion(response, character) {
|
|||||||
"indexRate": voice_settings["indexRate"],
|
"indexRate": voice_settings["indexRate"],
|
||||||
"filterRadius": voice_settings["filterRadius"],
|
"filterRadius": voice_settings["filterRadius"],
|
||||||
"rmsMixRate": voice_settings["rmsMixRate"],
|
"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());
|
const url = new URL(getApiUrl());
|
||||||
url.pathname = '/api/voice-conversion/rvc/process-audio';
|
url.pathname = '/api/voice-conversion/rvc/process-audio';
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ async function tts(text, voiceId, char) {
|
|||||||
|
|
||||||
// RVC injection
|
// RVC injection
|
||||||
if (extension_settings.rvc.enabled)
|
if (extension_settings.rvc.enabled)
|
||||||
response = await rvcVoiceConversion(response, char)
|
response = await rvcVoiceConversion(response, char, text)
|
||||||
|
|
||||||
addAudioJob(response)
|
addAudioJob(response)
|
||||||
completeTtsJob()
|
completeTtsJob()
|
||||||
|
Reference in New Issue
Block a user