From 5abfe732e44d10716500907122e8ec645f72ace2 Mon Sep 17 00:00:00 2001 From: Masato Kikuchi Date: Mon, 31 Mar 2025 22:45:55 +0900 Subject: [PATCH] fix bug --- Cargo.lock | 2 ++ crates/sbv2_editor/Cargo.toml | 4 +++- crates/sbv2_editor/src/main.rs | 10 ++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 839c8a5..6a64f06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2318,6 +2318,8 @@ version = "0.2.0-alpha6" dependencies = [ "anyhow", "axum", + "dotenvy", + "env_logger", "log", "sbv2_core", "serde", diff --git a/crates/sbv2_editor/Cargo.toml b/crates/sbv2_editor/Cargo.toml index 3d7ffab..3dd2501 100644 --- a/crates/sbv2_editor/Cargo.toml +++ b/crates/sbv2_editor/Cargo.toml @@ -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"] } diff --git a/crates/sbv2_editor/src/main.rs b/crates/sbv2_editor/src/main.rs index 9c28534..3cf4859 100644 --- a/crates/sbv2_editor/src/main.rs +++ b/crates/sbv2_editor/src/main.rs @@ -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, + 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,