From c5dfb5e349d1199e499f6af587a7d64ad01eaa9c Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Thu, 16 Mar 2023 02:40:18 +0900 Subject: [PATCH] Fix audio query parameters and payload data types --- voicevox/audio_query.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/voicevox/audio_query.py b/voicevox/audio_query.py index 579ee86..d06a652 100644 --- a/voicevox/audio_query.py +++ b/voicevox/audio_query.py @@ -113,8 +113,7 @@ class AudioQuery: """ def __init__( - self, http: HttpClient, payload: AudioQueryType, - speaker: int + self, http: HttpClient, payload: AudioQueryType ): self.http = http self.__data = payload @@ -132,8 +131,6 @@ def __init__( self.output_sampling_rate: int = payload["outputSamplingRate"] self.output_stereo: bool = payload["outputStereo"] - self.speaker = speaker - @property def kana(self) -> str: return self.__data["kana"] @@ -157,10 +154,10 @@ def to_dict(self) -> AudioQueryType: async def synthesis( self, *, enable_interrogative_upspeak: bool = True, - core_version: Optional[str] = None, speaker: Optional[int] = None + speaker: int, core_version: Optional[str] = None ) -> bytes: params = { - "speaker": speaker or self.speaker, + "speaker": speaker, "enable_interrogative_upspeak": enable_interrogative_upspeak } if core_version is not None: