Skip to content

Commit

Permalink
fix: Python APIとexample/python/run.pyの型付けを直す (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip authored Oct 30, 2024
1 parent 5641e37 commit e094b52
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ class OpenJtalk:
"""
...

class AudioFeature:
@property
def frame_length(self) -> int: ...
@property
def frame_rate(self) -> float: ...

class Synthesizer:
"""
音声シンセサイザ。
Expand Down Expand Up @@ -351,6 +357,18 @@ class Synthesizer:
スタイルID。
"""
...
def precompute_render(
self,
audio_query: AudioQuery,
style_id: Union[StyleId, int],
enable_interrogative_upspeak: bool = True,
) -> AudioFeature: ...
def render(
self,
audio: AudioFeature,
start: int,
end: int,
) -> bytes: ...
def synthesis(
self,
audio_query: AudioQuery,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# pyright: reportMissingModuleSource=false
from ._rust.blocking import (
AudioFeature,
Onnxruntime,
OpenJtalk,
Synthesizer,
UserDict,
VoiceModelFile,
)

__all__ = ["Onnxruntime", "OpenJtalk", "Synthesizer", "UserDict", "VoiceModelFile"]
__all__ = [
"AudioFeature",
"Onnxruntime",
"OpenJtalk",
"Synthesizer",
"UserDict",
"VoiceModelFile",
]
2 changes: 1 addition & 1 deletion example/python/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main() -> None:
logger.info("%s", f"Wrote `{out}`")


def parse_args() -> Tuple[AccelerationMode, Path, str, Path, str, Path, int]:
def parse_args() -> Tuple[AccelerationMode, Path, str, Path, str, Path, int, bool]:
argparser = ArgumentParser()
argparser.add_argument(
"--mode",
Expand Down

0 comments on commit e094b52

Please sign in to comment.