Skip to content

Update submodule #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion binding/voicevox_core
Submodule voicevox_core updated 32 files
+70 −104 .github/workflows/download_test.yml
+172 −65 Cargo.lock
+4 −2 Cargo.toml
+3 −0 crates/downloader/Cargo.toml
+163 −67 crates/downloader/src/main.rs
+1 −0 crates/voicevox_core/src/__internal/interop.rs
+1 −140 crates/voicevox_core/src/engine/model.rs
+0 −2 crates/voicevox_core/src/synthesizer.rs
+1 −1 crates/voicevox_core/src/user_dict/mod.rs
+190 −34 crates/voicevox_core/src/user_dict/word.rs
+3 −1 crates/voicevox_core_c_api/include/voicevox_core.h
+7 −5 crates/voicevox_core_c_api/src/lib.rs
+1 −0 crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_load.rs
+4 −4 crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_manipulate.rs
+0 −8 crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/AudioQuery.java
+9 −76 crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/UserDictWord.java
+6 −38 crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/blocking/UserDict.java
+6 −5 crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/blocking/UserDictTest.java
+3 −3 crates/voicevox_core_java_api/src/common.rs
+81 −20 crates/voicevox_core_java_api/src/user_dict.rs
+3 −3 crates/voicevox_core_python_api/poetry.lock
+1 −0 crates/voicevox_core_python_api/python/test/test_asyncio_user_dict_load.py
+6 −1 crates/voicevox_core_python_api/python/test/test_asyncio_user_dict_manipulate.py
+0 −2 crates/voicevox_core_python_api/python/test/test_audio_query.py
+1 −0 crates/voicevox_core_python_api/python/test/test_blocking_user_dict_load.py
+6 −2 crates/voicevox_core_python_api/python/test/test_blocking_user_dict_manipulate.py
+10 −30 crates/voicevox_core_python_api/python/voicevox_core/_models/__init__.py
+6 −1 crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.pyi
+22 −5 crates/voicevox_core_python_api/src/convert.rs
+5 −5 crates/voicevox_core_python_api/src/lib.rs
+2 −2 deny.toml
+1 −1 example/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,13 @@ internal static unsafe partial class CoreUnsafe
///
/// @param [in] surface 表記
/// @param [in] pronunciation 読み
/// @param [in] accent_type アクセント型
/// @returns ::VoicevoxUserDictWord
///
/// \orig-impl{voicevox_user_dict_word_make}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_user_dict_word_make", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation);
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation, nuint accent_type);

/// <summary>
/// ユーザー辞書をb&gt;構築&lt;/b&gt;(_construct_)する。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ internal UserDictWord(string surface, string pronunciation)
/// </summary>
public uint Priority { get; set; }

public static UserDictWord Create(string surface, string pronunciation)
public static UserDictWord Create(string surface, string pronunciation, nuint accentType)
{
unsafe
{
fixed (byte* ptrSurface = System.Text.Encoding.UTF8.GetBytes(surface))
{
fixed (byte* ptrPronunciation = System.Text.Encoding.UTF8.GetBytes(pronunciation))
{
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation);
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation, accentType);
return unsafeUserDictWord.FromNative();
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/VoicevoxCoreSharp.Core/Native/CoreUnsafe.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,13 @@ internal static unsafe partial class CoreUnsafe
///
/// @param [in] surface 表記
/// @param [in] pronunciation 読み
/// @param [in] accent_type アクセント型
/// @returns ::VoicevoxUserDictWord
///
/// \orig-impl{voicevox_user_dict_word_make}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_user_dict_word_make", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation);
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation, nuint accent_type);

/// <summary>
/// ユーザー辞書をb&gt;構築&lt;/b&gt;(_construct_)する。
Expand Down
4 changes: 2 additions & 2 deletions src/VoicevoxCoreSharp.Core/Struct/UserDictWord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ internal UserDictWord(string surface, string pronunciation)
/// </summary>
public uint Priority { get; set; }

public static UserDictWord Create(string surface, string pronunciation)
public static UserDictWord Create(string surface, string pronunciation, nuint accentType)
{
unsafe
{
fixed (byte* ptrSurface = System.Text.Encoding.UTF8.GetBytes(surface))
{
fixed (byte* ptrPronunciation = System.Text.Encoding.UTF8.GetBytes(pronunciation))
{
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation);
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation, accentType);
return unsafeUserDictWord.FromNative();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VoicevoxOnnxRuntimeVersion>1.17.3</VoicevoxOnnxRuntimeVersion>
<VoicevoxCoreCommitHash>849f5b0d701450623ade6767a89ce03ce5a28536</VoicevoxCoreCommitHash>
<VoicevoxCoreCommitHash>fb2a1e230be3597ab1f220ce34e7c11d292121c0</VoicevoxCoreCommitHash>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion tests/VoicevoxCoreSharp.Core.Tests/OpenJtalkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void UseUserDict()
OpenJtalk.New(Consts.OpenJTalkDictDir, out var openJtalk);
// 空っぽの辞書をコンパイルしようとするとクラッシュするので足す
var userDict = new UserDict();
userDict.AddWord(UserDictWord.Create("hoge", "ホゲ"), out var _);
userDict.AddWord(UserDictWord.Create("hoge", "ホゲ", 0), out var _);

var result = openJtalk.UseUserDict(userDict);

Expand Down
6 changes: 3 additions & 3 deletions tests/VoicevoxCoreSharp.Core.Tests/UserDictTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ public void CreateDelete()
nuint accentType = 2;
var wordType = UserDictWordType.ADJECTIVE;

var word = UserDictWord.Create("hoge", pronunciation);
var word = UserDictWord.Create("hoge", pronunciation, accentType);
word.WordType = wordType;
word.AccentType = accentType;
word.Priority = priority;

var addResult = userDict.AddWord(word, out var wordUuid);
Expand All @@ -54,7 +53,8 @@ public void CreateDelete()

var result = userDict.ToJson(out var json);
Assert.Equal(ResultCode.RESULT_OK, result);
Assert.Equal($"{{\"{wordUuid}\":{{\"surface\":\"hoge\",\"pronunciation\":\"{pronunciation}\",\"accent_type\":{accentType},\"word_type\":\"ADJECTIVE\",\"priority\":{priority},\"mora_count\":2}}}}", json);
var expectedJson = $"{{\"{wordUuid}\":{{\"surface\":\"hoge\",\"priority\":{priority},\"context_id\":20,\"part_of_speech\":\"形容詞\",\"part_of_speech_detail_1\":\"自立\",\"part_of_speech_detail_2\":\"*\",\"part_of_speech_detail_3\":\"*\",\"inflectional_type\":\"*\",\"inflectional_form\":\"*\",\"stem\":\"*\",\"yomi\":\"ホゲ\",\"pronunciation\":\"{pronunciation}\",\"accent_type\":{accentType},\"mora_count\":2,\"accent_associative_rule\":\"*\"}}}}";
Assert.Equal(expectedJson, json);

var removeResult = userDict.RemoveWord(wordUuid);
Assert.Equal(ResultCode.RESULT_OK, removeResult);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"6d3a0135-6bb4-4183-9b81-5d17688d6d0f":{"surface":"hoge","pronunciation":"ホゲ","accent_type":2,"word_type":"ADJECTIVE","priority":10,"mora_count":2}}
{"b6649a1f-ec83-48ad-b7a7-dcb7b308dce8":{"surface":"hoge","priority":10,"context_id":20,"part_of_speech":"形容詞","part_of_speech_detail_1":"自立","part_of_speech_detail_2":"*","part_of_speech_detail_3":"*","inflectional_type":"*","inflectional_form":"*","stem":"*","yomi":"ホゲ","pronunciation":"ホゲ","accent_type":2,"mora_count":2,"accent_associative_rule":"*"}}
Loading