mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-14 18:32:55 +00:00
fix bug
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2318,6 +2318,8 @@ version = "0.2.0-alpha6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
"dotenvy",
|
||||
"env_logger",
|
||||
"log",
|
||||
"sbv2_core",
|
||||
"serde",
|
||||
|
||||
@@ -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"] }
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user