Skip to content
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

fix: Python APIとexample/python/run.pyの型付けを直す #864

Merged
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
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
Loading