@@ -582,6 +582,7 @@ def __init__(
582582 cpu_num_threads : int = 0 ,
583583 load_all_models : bool = False ,
584584 ) -> None :
585+ """コアを利用可能にする。"""
585586 self .default_sampling_rate = 24000
586587
587588 self .core = load_core (core_dir , use_gpu )
@@ -620,6 +621,7 @@ def __init__(
620621 os .chdir (cwd )
621622
622623 def metas (self ) -> str :
624+ """キャラクターメタ情報を文字列として取得する。"""
623625 metas_bytes : bytes = self .core .metas ()
624626 return metas_bytes .decode ("utf-8" )
625627
@@ -630,7 +632,7 @@ def yukarin_s_forward(
630632 style_id : NDArray [np .int64 ],
631633 ) -> NDArray [np .float32 ]:
632634 """
633- 音素列から、音素ごとの長さを求める関数
635+ 音素列から音素ごとの長さを求める。
634636
635637 Parameters
636638 ----------
@@ -669,7 +671,7 @@ def yukarin_sa_forward(
669671 style_id : NDArray [np .int64 ],
670672 ) -> NDArray [np .float32 ]:
671673 """
672- モーラごとの音素列とアクセント情報から、モーラごとの音高を求める関数
674+ モーラごとの音素列とアクセント情報からモーラごとの音高を求める。
673675
674676 Parameters
675677 ----------
@@ -726,7 +728,7 @@ def decode_forward(
726728 style_id : NDArray [np .int64 ],
727729 ) -> NDArray [np .float32 ]:
728730 """
729- フレームごとの音素と音高から波形を求める関数
731+ フレームごとの音素と音高から波形を求める。
730732
731733 Parameters
732734 ----------
@@ -768,7 +770,7 @@ def predict_sing_consonant_length_forward(
768770 style_id : NDArray [np .int64 ],
769771 ) -> NDArray [np .int64 ]:
770772 """
771- 子音・母音列から、音素ごとの長さを求める関数
773+ 子音・母音列から音素ごとの長さを求める。
772774
773775 Parameters
774776 ----------
@@ -811,7 +813,7 @@ def predict_sing_f0_forward(
811813 style_id : NDArray [np .int64 ],
812814 ) -> NDArray [np .float32 ]:
813815 """
814- フレームごとの音素列とノート列から、フレームごとのF0を求める関数
816+ フレームごとの音素列とノート列からフレームごとのF0を求める。
815817
816818 Parameters
817819 ----------
@@ -852,7 +854,7 @@ def predict_sing_volume_forward(
852854 style_id : NDArray [np .int64 ],
853855 ) -> NDArray [np .float32 ]:
854856 """
855- フレームごとの音素列とノート列から、フレームごとのvolumeを求める関数
857+ フレームごとの音素列とノート列からフレームごとの音量を求める。
856858
857859 Parameters
858860 ----------
@@ -896,7 +898,7 @@ def sf_decode_forward(
896898 style_id : NDArray [np .int64 ],
897899 ) -> NDArray [np .float32 ]:
898900 """
899- フレームごとの音素と音高から波形を求める関数
901+ フレームごとの音素と音高から波形を求める。
900902
901903 Parameters
902904 ----------
@@ -932,30 +934,34 @@ def sf_decode_forward(
932934 raise OldCoreError
933935
934936 def supported_devices (self ) -> str :
935- """coreから取得した対応デバイスに関するjsonデータの文字列 。"""
937+ """コアが対応するデバイスの情報をJSON文字列として取得する 。"""
936938 if self .api_exists ["supported_devices" ]:
937939 supported_devices_byte : bytes = self .core .supported_devices ()
938940 return supported_devices_byte .decode ("utf-8" )
939941 raise OldCoreError
940942
941943 def finalize (self ) -> None :
944+ """コアをファイナライズする。"""
942945 if self .api_exists ["finalize" ]:
943946 self .core .finalize ()
944947 return
945948 raise OldCoreError
946949
947950 def load_model (self , style_id : int ) -> None :
951+ """コアにモデルを読み込む。"""
948952 if self .api_exists ["load_model" ]:
949953 self .assert_core_success (self .core .load_model (c_long (style_id )))
950954 raise OldCoreError
951955
952956 def is_model_loaded (self , style_id : int ) -> bool :
957+ """コアに指定されたモデルが読み込まれているか確認する。"""
953958 if self .api_exists ["is_model_loaded" ]:
954959 loaded_bool : bool = self .core .is_model_loaded (c_long (style_id ))
955960 return loaded_bool
956961 raise OldCoreError
957962
958963 def assert_core_success (self , result : bool ) -> None :
964+ """コアの失敗を表すコードが現れた場合に Python 例外へ変換する。"""
959965 if not result :
960966 raise CoreError (
961967 self .core .last_error_message ().decode ("utf-8" , "backslashreplace" )
0 commit comments