File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ mod voicevox;
9
9
10
10
use crate :: aivoice:: AIVOICE ;
11
11
use crate :: icon_manager:: ICON_MANAGER ;
12
+ use crate :: routes:: audio_query:: OPEN_JTALK ;
13
+ use crate :: routes:: user_dict:: USER_DICT ;
12
14
13
15
use anyhow:: Result ;
14
16
use axum:: {
@@ -121,6 +123,11 @@ async fn main_impl(args: Cli) -> Result<()> {
121
123
122
124
info ! ( "Starting server..." ) ;
123
125
126
+ {
127
+ let open_jtalk = OPEN_JTALK . lock ( ) . await ;
128
+ let user_dict = USER_DICT . lock ( ) . await ;
129
+ open_jtalk. use_user_dict ( & user_dict) ?;
130
+ }
124
131
info ! ( "Listening on port {}" , port) ;
125
132
126
133
axum:: Server :: bind ( & addr)
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use tracing::warn;
11
11
12
12
use crate :: error:: { Error , Result } ;
13
13
14
- static USER_DICT : Lazy < Arc < Mutex < UserDict > > > = Lazy :: new ( || {
14
+ pub static USER_DICT : Lazy < Arc < Mutex < UserDict > > > = Lazy :: new ( || {
15
15
let mut user_dict = UserDict :: new ( ) ;
16
16
17
17
if std:: fs:: metadata ( & * USER_DICT_PATH ) . is_ok ( ) {
@@ -21,7 +21,7 @@ static USER_DICT: Lazy<Arc<Mutex<UserDict>>> = Lazy::new(|| {
21
21
Arc :: new ( Mutex :: new ( user_dict) )
22
22
} ) ;
23
23
24
- static USER_DICT_PATH : Lazy < String > = Lazy :: new ( || {
24
+ pub static USER_DICT_PATH : Lazy < String > = Lazy :: new ( || {
25
25
process_path:: get_executable_path ( )
26
26
. unwrap ( )
27
27
. parent ( )
You can’t perform that action at this time.
0 commit comments