Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna2134 committed Sep 17, 2024
1 parent ec3e412 commit be0370a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions sbv2_api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use axum::{
routing::{get, post},
Json, Router,
};
use sbv2_core::tts::{TTSModelHolder, SynthesizeOptions};
use sbv2_core::tts::{SynthesizeOptions, TTSModelHolder};
use serde::Deserialize;
use std::env;
use std::sync::Arc;
Expand Down Expand Up @@ -49,11 +49,16 @@ async fn synthesize(
log::debug!("processing request: text={text}, ident={ident}, sdp_ratio={sdp_ratio}, length_scale={length_scale}");
let buffer = {
let tts_model = state.tts_model.lock().await;
tts_model.easy_synthesize(&ident, &text, 0, SynthesizeOptions {
sdp_ratio,
length_scale,
..Default::default()
})?
tts_model.easy_synthesize(
&ident,
&text,
0,
SynthesizeOptions {
sdp_ratio,
length_scale,
..Default::default()
},
)?
};
Ok(([(CONTENT_TYPE, "audio/wav")], buffer))
}
Expand Down

0 comments on commit be0370a

Please sign in to comment.