@@ -11,7 +11,7 @@ static WannaCRI()
1111 PythonEngine . PythonPath = $ "{ Path . Combine ( StaticSettings . exeDir , "WannaCRI" ) } ;{ Path . Combine ( StaticSettings . exeDir , "Python" ) } ";
1212 }
1313
14- private static void RunWannaCRIWithArgs ( string [ ] args , string workDir )
14+ private static void RunWannaCRIWithArgs ( params string [ ] args )
1515 {
1616 PythonEngine . Initialize ( ) ;
1717 using ( Py . GIL ( ) )
@@ -45,10 +45,6 @@ def _Popen_no_window(*args, **kwargs):
4545 argv . Append ( new PyString ( arg ) ) ;
4646 }
4747
48- argv . Append ( new PyString ( "--ffprobe" ) ) ;
49- argv . Append ( new PyString ( Path . Combine ( StaticSettings . exeDir , "ffprobe.exe" ) ) ) ;
50- argv . Append ( new PyString ( "--output" ) ) ;
51- argv . Append ( new PyString ( workDir ) ) ;
5248 sys . SetAttr ( "argv" , argv ) ;
5349
5450 var wannacri = scope . Import ( "wannacri" ) ;
@@ -63,11 +59,11 @@ def _Popen_no_window(*args, **kwargs):
6359
6460 public static void CreateUsm ( string src , string key = defaultKey )
6561 {
66- RunWannaCRIWithArgs ( [ "createusm" , src , "--key" , key ] , Path . GetDirectoryName ( src ) ) ;
62+ RunWannaCRIWithArgs ( "createusm" , src , "--key" , key , "--ffprobe" , Path . Combine ( StaticSettings . exeDir , "ffprobe.exe" ) , "--output" , Path . GetDirectoryName ( src ) ) ;
6763 }
6864
69- public static void UnpackUsm ( string src , string key = defaultKey )
65+ public static void UnpackUsm ( string src , string output , string key = defaultKey )
7066 {
71- RunWannaCRIWithArgs ( [ "extractusm" , src , "--key" , key ] , Path . GetDirectoryName ( src ) ) ;
67+ RunWannaCRIWithArgs ( "extractusm" , src , "--key" , key , "--output" , output ) ;
7268 }
7369}
0 commit comments