Skip to content

Commit 6e9af14

Browse files
committed
accentTypeのパラメータが増えたことの追従
1 parent fa5786e commit 6e9af14

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

src/VoicevoxCoreSharp.Core.Unity/Packages/VoicevoxCoreSharp.Core.Unity/Runtime/Script/Native/CoreUnsafe.g.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,13 @@ internal static unsafe partial class CoreUnsafe
768768
///
769769
/// @param [in] surface 表記
770770
/// @param [in] pronunciation 読み
771+
/// @param [in] accent_type アクセント型
771772
/// @returns ::VoicevoxUserDictWord
772773
///
773774
/// \orig-impl{voicevox_user_dict_word_make}
774775
/// </summary>
775776
[DllImport(__DllName, EntryPoint = "voicevox_user_dict_word_make", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
776-
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation);
777+
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation, nuint accent_type);
777778

778779
/// <summary>
779780
/// ユーザー辞書をb&gt;構築&lt;/b&gt;(_construct_)する。

src/VoicevoxCoreSharp.Core.Unity/Packages/VoicevoxCoreSharp.Core.Unity/Runtime/Script/Struct/UserDictWord.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ internal UserDictWord(string surface, string pronunciation)
4040
/// </summary>
4141
public uint Priority { get; set; }
4242

43-
public static UserDictWord Create(string surface, string pronunciation)
43+
public static UserDictWord Create(string surface, string pronunciation, nuint accentType)
4444
{
4545
unsafe
4646
{
4747
fixed (byte* ptrSurface = System.Text.Encoding.UTF8.GetBytes(surface))
4848
{
4949
fixed (byte* ptrPronunciation = System.Text.Encoding.UTF8.GetBytes(pronunciation))
5050
{
51-
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation);
51+
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation, accentType);
5252
return unsafeUserDictWord.FromNative();
5353
}
5454
}

src/VoicevoxCoreSharp.Core/Native/CoreUnsafe.g.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,13 @@ internal static unsafe partial class CoreUnsafe
768768
///
769769
/// @param [in] surface 表記
770770
/// @param [in] pronunciation 読み
771+
/// @param [in] accent_type アクセント型
771772
/// @returns ::VoicevoxUserDictWord
772773
///
773774
/// \orig-impl{voicevox_user_dict_word_make}
774775
/// </summary>
775776
[DllImport(__DllName, EntryPoint = "voicevox_user_dict_word_make", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
776-
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation);
777+
internal static extern VoicevoxUserDictWord voicevox_user_dict_word_make(byte* surface, byte* pronunciation, nuint accent_type);
777778

778779
/// <summary>
779780
/// ユーザー辞書をb&gt;構築&lt;/b&gt;(_construct_)する。

src/VoicevoxCoreSharp.Core/Struct/UserDictWord.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ internal UserDictWord(string surface, string pronunciation)
4040
/// </summary>
4141
public uint Priority { get; set; }
4242

43-
public static UserDictWord Create(string surface, string pronunciation)
43+
public static UserDictWord Create(string surface, string pronunciation, nuint accentType)
4444
{
4545
unsafe
4646
{
4747
fixed (byte* ptrSurface = System.Text.Encoding.UTF8.GetBytes(surface))
4848
{
4949
fixed (byte* ptrPronunciation = System.Text.Encoding.UTF8.GetBytes(pronunciation))
5050
{
51-
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation);
51+
var unsafeUserDictWord = CoreUnsafe.voicevox_user_dict_word_make(ptrSurface, ptrPronunciation, accentType);
5252
return unsafeUserDictWord.FromNative();
5353
}
5454
}

tests/VoicevoxCoreSharp.Core.Tests/OpenJtalkTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void UseUserDict()
2222
OpenJtalk.New(Consts.OpenJTalkDictDir, out var openJtalk);
2323
// 空っぽの辞書をコンパイルしようとするとクラッシュするので足す
2424
var userDict = new UserDict();
25-
userDict.AddWord(UserDictWord.Create("hoge", "ホゲ"), out var _);
25+
userDict.AddWord(UserDictWord.Create("hoge", "ホゲ", 0), out var _);
2626

2727
var result = openJtalk.UseUserDict(userDict);
2828

tests/VoicevoxCoreSharp.Core.Tests/UserDictTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ public void CreateDelete()
4343
nuint accentType = 2;
4444
var wordType = UserDictWordType.ADJECTIVE;
4545

46-
var word = UserDictWord.Create("hoge", pronunciation);
46+
var word = UserDictWord.Create("hoge", pronunciation, accentType);
4747
word.WordType = wordType;
48-
word.AccentType = accentType;
4948
word.Priority = priority;
5049

5150
var addResult = userDict.AddWord(word, out var wordUuid);

0 commit comments

Comments
 (0)