From a8cbb88fe07f7839ef2558f0b2e4fb9015d3a0df Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sun, 29 Dec 2024 16:16:55 +0900 Subject: [PATCH] =?UTF-8?q?feat!:=20=E3=83=93=E3=83=AB=E3=83=80=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB=E3=81=AE=E7=B7=A0=E3=82=81?= =?UTF-8?q?=E3=81=AE"exec"/"execute"=E3=82=92"perform"=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING-CHANGE: Java APIのメソッド名変更 --- .../src/__internal/doctest_fixtures.rs | 2 +- crates/voicevox_core/src/devices.rs | 2 +- .../src/infer/runtimes/onnxruntime.rs | 20 +++++------ crates/voicevox_core/src/synthesizer.rs | 36 +++++++++---------- crates/voicevox_core_c_api/src/c_impls.rs | 2 +- .../src/compatible_engine.rs | 2 +- crates/voicevox_core_c_api/src/lib.rs | 6 ++-- .../voicevoxcore/blocking/Onnxruntime.java | 4 +-- .../voicevoxcore/blocking/Synthesizer.java | 12 +++---- .../jp/hiroshiba/voicevoxcore/TestUtils.java | 2 +- .../blocking/SynthesizerTest.java | 4 +-- .../voicevox_core_java_api/src/onnxruntime.rs | 2 +- .../voicevox_core_java_api/src/synthesizer.rs | 6 ++-- crates/voicevox_core_python_api/src/lib.rs | 18 +++++----- example/kotlin/app/src/main/kotlin/app/App.kt | 4 +-- 15 files changed, 61 insertions(+), 61 deletions(-) diff --git a/crates/voicevox_core/src/__internal/doctest_fixtures.rs b/crates/voicevox_core/src/__internal/doctest_fixtures.rs index b1122f874..9ccb2282a 100644 --- a/crates/voicevox_core/src/__internal/doctest_fixtures.rs +++ b/crates/voicevox_core/src/__internal/doctest_fixtures.rs @@ -17,7 +17,7 @@ pub async fn synthesizer_with_sample_voice_model( #[cfg(feature = "load-onnxruntime")] crate::nonblocking::Onnxruntime::load_once() .filename(onnxruntime_dylib_path) - .exec() + .perform() .await?, #[cfg(feature = "link-onnxruntime")] crate::nonblocking::Onnxruntime::init_once().await?, diff --git a/crates/voicevox_core/src/devices.rs b/crates/voicevox_core/src/devices.rs index ea46db6cf..eea994208 100644 --- a/crates/voicevox_core/src/devices.rs +++ b/crates/voicevox_core/src/devices.rs @@ -63,7 +63,7 @@ fn test_gpu( /// # } else { /// # voicevox_core::blocking::Onnxruntime::LIB_VERSIONED_FILENAME /// # }) -/// # .exec()?; +/// # .perform()?; /// # /// let onnxruntime = Onnxruntime::get().unwrap(); /// dbg!(SupportedDevices::THIS & onnxruntime.supported_devices()?); diff --git a/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs b/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs index bdb4a7daa..9d7d2364e 100644 --- a/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs +++ b/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs @@ -293,9 +293,9 @@ pub(crate) mod blocking { /// # // Windows\System32\onnxruntime.dllを回避 /// # voicevox_core::blocking::Onnxruntime::load_once() /// # .filename(test_util::ONNXRUNTIME_DYLIB_PATH) - /// # .exec()?; + /// # .perform()?; /// # } - /// let ort1 = voicevox_core::blocking::Onnxruntime::load_once().exec()?; + /// let ort1 = voicevox_core::blocking::Onnxruntime::load_once().perform()?; /// let ort2 = another_lib::nonblocking::Onnxruntime::get().expect("`ort1`と同一のはず"); /// assert_eq!(ptr_addr(ort1), ptr_addr(ort2)); /// @@ -407,7 +407,7 @@ pub(crate) mod blocking { { Self::load_once() .filename(test_util::ONNXRUNTIME_DYLIB_PATH) - .exec() + .perform() .map_err(Into::into) } @@ -425,7 +425,7 @@ pub(crate) mod blocking { /// [`Onnxruntime::load_once`]のビルダー。 #[cfg(feature = "load-onnxruntime")] - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct LoadOnce { filename: std::ffi::OsString, } @@ -453,7 +453,7 @@ pub(crate) mod blocking { } /// 実行する。 - pub fn exec(self) -> crate::Result<&'static Onnxruntime> { + pub fn perform(self) -> crate::Result<&'static Onnxruntime> { Onnxruntime::once(|| ort::try_init_from(&self.filename, None)) } } @@ -483,10 +483,10 @@ pub(crate) mod nonblocking { /// # // Windows\System32\onnxruntime.dllを回避 /// # voicevox_core::blocking::Onnxruntime::load_once() /// # .filename(test_util::ONNXRUNTIME_DYLIB_PATH) - /// # .exec()?; + /// # .perform()?; /// # } /// let ort1 = voicevox_core::nonblocking::Onnxruntime::load_once() - /// .exec() + /// .perform() /// .await?; /// let ort2 = another_lib::blocking::Onnxruntime::get().expect("`ort1`と同一のはず"); /// assert_eq!(ptr_addr(ort1), ptr_addr(ort2)); @@ -587,7 +587,7 @@ pub(crate) mod nonblocking { /// [`Onnxruntime::load_once`]のビルダー。 #[cfg(feature = "load-onnxruntime")] #[derive(Default)] - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct LoadOnce(super::blocking::LoadOnce); #[cfg(feature = "load-onnxruntime")] @@ -604,8 +604,8 @@ pub(crate) mod nonblocking { } /// 実行する。 - pub async fn exec(self) -> crate::Result<&'static Onnxruntime> { - let inner = crate::task::asyncify(|| self.0.exec()).await?; + pub async fn perform(self) -> crate::Result<&'static Onnxruntime> { + let inner = crate::task::asyncify(|| self.0.perform()).await?; Ok(Onnxruntime::from_blocking(inner)) } } diff --git a/crates/voicevox_core/src/synthesizer.rs b/crates/voicevox_core/src/synthesizer.rs index 7c559ca39..5ecff9b05 100644 --- a/crates/voicevox_core/src/synthesizer.rs +++ b/crates/voicevox_core/src/synthesizer.rs @@ -1332,10 +1332,10 @@ pub(crate) mod blocking { /// # // Windows\System32\onnxruntime.dllを回避 /// # voicevox_core::blocking::Onnxruntime::load_once() /// # .filename(test_util::ONNXRUNTIME_DYLIB_PATH) - /// # .exec()?; + /// # .perform()?; /// # } /// // FIXME: `Synthesizer`には`&mut self`なメソッドはもう無いはず - /// let mut syntesizer = Synthesizer::builder(Onnxruntime::load_once().exec()?) + /// let mut syntesizer = Synthesizer::builder(Onnxruntime::load_once().perform()?) /// .open_jtalk(Arc::new(OpenJtalk::new(OPEN_JTALK_DIC_DIR).unwrap())) // FIXME: `Arc`は要らないはず /// .acceleration_mode(ACCELERATION_MODE) /// .build()?; @@ -1780,7 +1780,7 @@ pub(crate) mod blocking { } // TODO: この`O`は削れるはず - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct PrecomputeRender<'a, O> { synthesizer: &'a Inner, audio_query: &'a AudioQuery, @@ -1795,7 +1795,7 @@ pub(crate) mod blocking { } /// 実行する。 - pub fn exec(self) -> crate::Result { + pub fn perform(self) -> crate::Result { self.synthesizer .precompute_render(self.audio_query, self.style_id, &self.options) .block_on() @@ -1803,7 +1803,7 @@ pub(crate) mod blocking { } // TODO: この`O`は削れるはず - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct Synthesis<'a, O> { synthesizer: &'a Inner, audio_query: &'a AudioQuery, @@ -1818,7 +1818,7 @@ pub(crate) mod blocking { } /// 実行する。 - pub fn exec(self) -> crate::Result> { + pub fn perform(self) -> crate::Result> { self.synthesizer .synthesis(self.audio_query, self.style_id, &self.options) .block_on() @@ -1826,7 +1826,7 @@ pub(crate) mod blocking { } // TODO: この`O`は削れるはず - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct TtsFromKana<'a, O> { synthesizer: &'a Inner, kana: &'a str, @@ -1841,14 +1841,14 @@ pub(crate) mod blocking { } /// 実行する。 - pub fn exec(self) -> crate::Result> { + pub fn perform(self) -> crate::Result> { self.synthesizer .tts_from_kana(self.kana, self.style_id, &self.options) .block_on() } } - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct Tts<'a, O> { synthesizer: &'a Inner, text: &'a str, @@ -1863,7 +1863,7 @@ pub(crate) mod blocking { } /// 実行する。 - pub fn exec(self) -> crate::Result> { + pub fn perform(self) -> crate::Result> { self.synthesizer .tts(self.text, self.style_id, &self.options) .block_on() @@ -1916,10 +1916,10 @@ pub(crate) mod nonblocking { /// # // Windows\System32\onnxruntime.dllを回避 /// # voicevox_core::blocking::Onnxruntime::load_once() /// # .filename(test_util::ONNXRUNTIME_DYLIB_PATH) - /// # .exec()?; + /// # .perform()?; /// # } /// // FIXME: `Synthesizer`には`&mut self`なメソッドはもう無いはず - /// let mut syntesizer = Synthesizer::builder(Onnxruntime::load_once().exec().await?) + /// let mut syntesizer = Synthesizer::builder(Onnxruntime::load_once().perform().await?) /// .open_jtalk(Arc::new(OpenJtalk::new(OPEN_JTALK_DIC_DIR).await.unwrap())) // FIXME: `Arc`は要らないはず /// .acceleration_mode(ACCELERATION_MODE) /// .build()?; @@ -2220,7 +2220,7 @@ pub(crate) mod nonblocking { } // TODO: この`O`は削れるはず - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct Synthesis<'a, O> { synthesizer: &'a Inner, audio_query: &'a AudioQuery, @@ -2235,7 +2235,7 @@ pub(crate) mod nonblocking { } /// 実行する。 - pub async fn exec(self) -> crate::Result> { + pub async fn perform(self) -> crate::Result> { self.synthesizer .synthesis(self.audio_query, self.style_id, &self.options) .await @@ -2243,7 +2243,7 @@ pub(crate) mod nonblocking { } // TODO: この`O`は削れるはず - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct TtsFromKana<'a, O> { synthesizer: &'a Inner, kana: &'a str, @@ -2258,14 +2258,14 @@ pub(crate) mod nonblocking { } /// 実行する。 - pub async fn exec(self) -> crate::Result> { + pub async fn perform(self) -> crate::Result> { self.synthesizer .tts_from_kana(self.kana, self.style_id, &self.options) .await } } - #[must_use = "this is a builder. it does nothing until `exec`uted"] + #[must_use = "this is a builder. it does nothing until `perform`ed"] pub struct Tts<'a, O> { synthesizer: &'a Inner, text: &'a str, @@ -2280,7 +2280,7 @@ pub(crate) mod nonblocking { } /// 実行する。 - pub async fn exec(self) -> crate::Result> { + pub async fn perform(self) -> crate::Result> { self.synthesizer .tts(self.text, self.style_id, &self.options) .await diff --git a/crates/voicevox_core_c_api/src/c_impls.rs b/crates/voicevox_core_c_api/src/c_impls.rs index 90f389799..8322325ef 100644 --- a/crates/voicevox_core_c_api/src/c_impls.rs +++ b/crates/voicevox_core_c_api/src/c_impls.rs @@ -45,7 +45,7 @@ impl VoicevoxOnnxruntime { let inner = voicevox_core::blocking::Onnxruntime::load_once() .filename(ensure_utf8(filename)?) - .exec()?; + .perform()?; Ok(Self::new(inner)) } diff --git a/crates/voicevox_core_c_api/src/compatible_engine.rs b/crates/voicevox_core_c_api/src/compatible_engine.rs index 1af020299..92097fa30 100644 --- a/crates/voicevox_core_c_api/src/compatible_engine.rs +++ b/crates/voicevox_core_c_api/src/compatible_engine.rs @@ -27,7 +27,7 @@ static ERROR_MESSAGE: LazyLock> = LazyLock::new(|| Mutex::new(Stri static ONNXRUNTIME: LazyLock<&'static voicevox_core::blocking::Onnxruntime> = LazyLock::new(|| { voicevox_core::blocking::Onnxruntime::load_once() - .exec() + .perform() .unwrap_or_else(|err| { display_error(&err); panic!("ONNX Runtimeをロードもしくは初期化ができなかったため、クラッシュします"); diff --git a/crates/voicevox_core_c_api/src/lib.rs b/crates/voicevox_core_c_api/src/lib.rs index 38d4706b6..8e5a3291b 100644 --- a/crates/voicevox_core_c_api/src/lib.rs +++ b/crates/voicevox_core_c_api/src/lib.rs @@ -1087,7 +1087,7 @@ pub unsafe extern "C" fn voicevox_synthesizer_synthesis( .body() .synthesis(&audio_query, StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec()?; + .perform()?; U8_SLICE_OWNER.own_and_lend(wav, output_wav, output_wav_length); Ok(()) })()) @@ -1149,7 +1149,7 @@ pub unsafe extern "C" fn voicevox_synthesizer_tts_from_kana( .body() .tts_from_kana(kana, StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec()?; + .perform()?; U8_SLICE_OWNER.own_and_lend(output, output_wav, output_wav_length); Ok(()) })()) @@ -1194,7 +1194,7 @@ pub unsafe extern "C" fn voicevox_synthesizer_tts( .body() .tts(text, StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec()?; + .perform()?; U8_SLICE_OWNER.own_and_lend(output, output_wav, output_wav_length); Ok(()) })()) diff --git a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Onnxruntime.java b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Onnxruntime.java index 5dc0430c9..17d820b24 100644 --- a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Onnxruntime.java +++ b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Onnxruntime.java @@ -14,7 +14,7 @@ *

シングルトンであり、インスタンスは高々一つ。 * *

- * Onnxruntime ort1 = Onnxruntime.loadOnce().exec();
+ * Onnxruntime ort1 = Onnxruntime.loadOnce().perform();
  * Onnxruntime ort2 = Onnxruntime.get().get();
  * assert ort1 == ort2;
  * 
@@ -96,7 +96,7 @@ public LoadOnce filename(@Nonnull String filename) { * * @return {@link Onnxruntime}。 */ - public Onnxruntime exec() { + public Onnxruntime perform() { synchronized (Onnxruntime.class) { if (instance == null) { instance = new Onnxruntime(filename); diff --git a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Synthesizer.java b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Synthesizer.java index 43f5fd776..3acc5b17d 100644 --- a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Synthesizer.java +++ b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/Synthesizer.java @@ -253,7 +253,7 @@ public List replaceMoraPitch(List accentPhrases, int * @param audioQuery {@link AudioQuery}。 * @param styleId スタイルID。 * @return {@link SynthesisConfigurator}。 - * @see SynthesisConfigurator#execute + * @see SynthesisConfigurator#perform */ @Nonnull public SynthesisConfigurator synthesis(AudioQuery audioQuery, int styleId) { @@ -266,7 +266,7 @@ public SynthesisConfigurator synthesis(AudioQuery audioQuery, int styleId) { * @param kana AquesTalk風記法。 * @param styleId スタイルID。 * @return {@link TtsFromKanaConfigurator}。 - * @see TtsFromKanaConfigurator#execute + * @see TtsFromKanaConfigurator#perform */ @Nonnull public TtsFromKanaConfigurator ttsFromKana(String kana, int styleId) { @@ -279,7 +279,7 @@ public TtsFromKanaConfigurator ttsFromKana(String kana, int styleId) { * @param text 日本語のテキスト。 * @param styleId スタイルID。 * @return {@link TtsConfigurator}。 - * @see TtsConfigurator#execute + * @see TtsConfigurator#perform */ @Nonnull public TtsConfigurator tts(String text, int styleId) { @@ -434,7 +434,7 @@ public SynthesisConfigurator interrogativeUpspeak(boolean interrogativeUpspeak) * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public byte[] execute() throws RunModelException { + public byte[] perform() throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -479,7 +479,7 @@ public TtsFromKanaConfigurator interrogativeUpspeak(boolean interrogativeUpspeak * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public byte[] execute() throws RunModelException { + public byte[] perform() throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -522,7 +522,7 @@ public TtsConfigurator interrogativeUpspeak(boolean interrogativeUpspeak) { * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public byte[] execute() throws RunModelException { + public byte[] perform() throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } diff --git a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/TestUtils.java b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/TestUtils.java index d73566b15..446c02fc5 100644 --- a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/TestUtils.java +++ b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/TestUtils.java @@ -22,7 +22,7 @@ protected Onnxruntime loadOnnxruntime() { final String FILENAME = "../../test_util/data/lib/" + Onnxruntime.LIB_VERSIONED_FILENAME; try { - return Onnxruntime.loadOnce().filename(FILENAME).exec(); + return Onnxruntime.loadOnce().filename(FILENAME).perform(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/blocking/SynthesizerTest.java b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/blocking/SynthesizerTest.java index d5582a028..c1ae7d4ca 100644 --- a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/blocking/SynthesizerTest.java +++ b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/blocking/SynthesizerTest.java @@ -81,7 +81,7 @@ void checkAudioQuery() throws RunModelException, InvalidModelDataException { } AudioQuery query = synthesizer.createAudioQuery("こんにちは", synthesizer.metas()[0].styles[0].id); - synthesizer.synthesis(query, synthesizer.metas()[0].styles[0].id).execute(); + synthesizer.synthesis(query, synthesizer.metas()[0].styles[0].id).perform(); } @Test @@ -124,6 +124,6 @@ void checkTts() throws RunModelException, InvalidModelDataException { try (VoiceModelFile model = openModel()) { synthesizer.loadVoiceModel(model); } - synthesizer.tts("こんにちは", synthesizer.metas()[0].styles[0].id).execute(); + synthesizer.tts("こんにちは", synthesizer.metas()[0].styles[0].id).perform(); } } diff --git a/crates/voicevox_core_java_api/src/onnxruntime.rs b/crates/voicevox_core_java_api/src/onnxruntime.rs index 78044c750..546ceba56 100644 --- a/crates/voicevox_core_java_api/src/onnxruntime.rs +++ b/crates/voicevox_core_java_api/src/onnxruntime.rs @@ -36,7 +36,7 @@ unsafe extern "system" fn Java_jp_hiroshiba_voicevoxcore_blocking_Onnxruntime_rs let filename = String::from(env.get_string(&filename)?); let internal = voicevox_core::blocking::Onnxruntime::load_once() .filename(filename) - .exec()?; + .perform()?; env.set_rust_field(&this, "handle", internal)?; Ok(()) }) diff --git a/crates/voicevox_core_java_api/src/synthesizer.rs b/crates/voicevox_core_java_api/src/synthesizer.rs index 023c5674b..ddbbf1ec6 100644 --- a/crates/voicevox_core_java_api/src/synthesizer.rs +++ b/crates/voicevox_core_java_api/src/synthesizer.rs @@ -431,7 +431,7 @@ unsafe extern "system" fn Java_jp_hiroshiba_voicevoxcore_blocking_Synthesizer_rs let wave = internal .synthesis(&audio_query, voicevox_core::StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak != 0) - .exec()?; + .perform()?; let j_bytes = env.byte_array_from_slice(&wave)?; @@ -463,7 +463,7 @@ unsafe extern "system" fn Java_jp_hiroshiba_voicevoxcore_blocking_Synthesizer_rs let wave = internal .tts_from_kana(&kana, voicevox_core::StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak != 0) - .exec()?; + .perform()?; let j_bytes = env.byte_array_from_slice(&wave)?; @@ -493,7 +493,7 @@ unsafe extern "system" fn Java_jp_hiroshiba_voicevoxcore_blocking_Synthesizer_rs let wave = internal .tts(&text, voicevox_core::StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak != 0) - .exec()?; + .perform()?; let j_bytes = env.byte_array_from_slice(&wave)?; diff --git a/crates/voicevox_core_python_api/src/lib.rs b/crates/voicevox_core_python_api/src/lib.rs index fc12a9712..ee5ab4364 100644 --- a/crates/voicevox_core_python_api/src/lib.rs +++ b/crates/voicevox_core_python_api/src/lib.rs @@ -406,7 +406,7 @@ mod blocking { .get_or_try_init(|| { let inner = voicevox_core::blocking::Onnxruntime::load_once() .filename(filename) - .exec() + .perform() .into_py_result(py)?; Py::new(py, Self(inner)) }) @@ -699,7 +699,7 @@ mod blocking { .read()? .precompute_render(&audio_query, StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .into_py_result(py)?; Ok(AudioFeature { audio }) } @@ -748,7 +748,7 @@ mod blocking { .read()? .synthesis(&audio_query, StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .into_py_result(py)?; Ok(PyBytes::new(py, wav)) } @@ -772,7 +772,7 @@ mod blocking { .read()? .tts_from_kana(kana, style_id) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .into_py_result(py)?; Ok(PyBytes::new(py, wav)) } @@ -796,7 +796,7 @@ mod blocking { .read()? .tts(text, style_id) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .into_py_result(py)?; Ok(PyBytes::new(py, wav)) } @@ -1008,7 +1008,7 @@ mod asyncio { pyo3_asyncio::tokio::future_into_py(py, async move { let inner = voicevox_core::nonblocking::Onnxruntime::load_once() .filename(filename) - .exec() + .perform() .await; ONNXRUNTIME.get_or_try_init(|| { @@ -1364,7 +1364,7 @@ mod asyncio { .read()? .synthesis(&audio_query, StyleId::new(style_id)) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .await; Python::with_gil(|py| { let wav = wav.into_py_result(py)?; @@ -1398,7 +1398,7 @@ mod asyncio { .read()? .tts_from_kana(&kana, style_id) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .await; Python::with_gil(|py| { @@ -1433,7 +1433,7 @@ mod asyncio { .read()? .tts(&text, style_id) .enable_interrogative_upspeak(enable_interrogative_upspeak) - .exec() + .perform() .await; Python::with_gil(|py| { diff --git a/example/kotlin/app/src/main/kotlin/app/App.kt b/example/kotlin/app/src/main/kotlin/app/App.kt index 0b8d05e33..8e2ce791e 100644 --- a/example/kotlin/app/src/main/kotlin/app/App.kt +++ b/example/kotlin/app/src/main/kotlin/app/App.kt @@ -33,7 +33,7 @@ fun main(args: Array) { parser.parse(args) println("Inititalizing: ${mode}, ${onnxruntime}, ${dictDir}") - val ort = Onnxruntime.loadOnce().filename(onnxruntime).exec() + val ort = Onnxruntime.loadOnce().filename(onnxruntime).perform() val openJtalk = OpenJtalk(dictDir) val synthesizer = Synthesizer.builder(ort, openJtalk) @@ -54,7 +54,7 @@ fun main(args: Array) { val audioQuery = synthesizer.createAudioQuery(text, styleId) println("Synthesizing...") - val audio = synthesizer.synthesis(audioQuery, styleId).execute() + val audio = synthesizer.synthesis(audioQuery, styleId).perform() println("Saving the audio to ${out}") File(out).writeBytes(audio)