This commit is contained in:
Masato Kikuchi
2025-03-31 22:45:55 +09:00
parent 48aef6cef4
commit 5abfe732e4
3 changed files with 11 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -2318,6 +2318,8 @@ version = "0.2.0-alpha6"
dependencies = [
"anyhow",
"axum",
"dotenvy",
"env_logger",
"log",
"sbv2_core",
"serde",

View File

@@ -11,7 +11,9 @@ documentation.workspace = true
[dependencies]
anyhow.workspace = true
axum = "0.8.1"
dotenvy.workspace = true
env_logger.workspace = true
log = "0.4.27"
sbv2_core = { version = "0.2.0-alpha6", path = "../sbv2_core" }
sbv2_core = { version = "0.2.0-alpha6", path = "../sbv2_core", features = ["aivmx"] }
serde = { version = "1.0.219", features = ["derive"] }
tokio = { version = "1.44.1", features = ["full"] }

View File

@@ -4,8 +4,9 @@ use axum::{
response::IntoResponse,
routing::{get, post},
Json, Router,
http::header::CONTENT_TYPE,
};
use sbv2_core::{jtalk::JTalk, tts::TTSModelHolder, tts_util::preprocess_parse_text};
use sbv2_core::{jtalk::JTalk, tts::{TTSModelHolder, SynthesizeOptions}, tts_util::preprocess_parse_text};
use serde::{Deserialize, Serialize};
use tokio::{fs, net::TcpListener, sync::Mutex};
@@ -51,11 +52,12 @@ async fn create_audio_query(
#[derive(Deserialize)]
pub struct RequestSynthesis {
text: String,
speaker_id: i32,
speaker_id: i64,
sdp_ratio: f32,
length_scale: f32,
style_id: i32,
audio_query: Vec<AudioQuery>,
ident: String,
}
async fn synthesis(
@@ -68,8 +70,8 @@ async fn synthesis(
let buffer = {
let mut tts_model = state.tts_model.lock().await;
tts_model.easy_synthesize_neo(
&ident,
&text,
&request.ident,
&request.text,
Some(tones),
request.style_id,
request.speaker_id,