Skip to content

Commit

Permalink
Merge pull request #54 from voicevox-client/tuna2134-patch-4
Browse files Browse the repository at this point in the history
Change speaker to style_id
  • Loading branch information
tuna2134 authored Dec 26, 2023
2 parents 3955f46 + 9dd26da commit 488986b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
@pytest.mark.asyncio
async def test_basic():
async with Client() as client:
audio_query = await client.create_audio_query("こんにちは!", speaker=1)
await audio_query.synthesis(speaker=1)
audio_query = await client.create_audio_query("こんにちは!", style_id=1)
await audio_query.synthesis(style_id=1)
4 changes: 2 additions & 2 deletions voicevox/audio_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ async def synthesis(
self,
*,
enable_interrogative_upspeak: bool = True,
speaker: int,
style_id: int,
core_version: Optional[str] = None,
) -> bytes:
params = {
"speaker": speaker,
"style_id": style_id,
"enable_interrogative_upspeak": enable_interrogative_upspeak,
}
if core_version is not None:
Expand Down
4 changes: 2 additions & 2 deletions voicevox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def __aexit__(self, *args) -> None:
await self.close()

async def create_audio_query(
self, text: str, speaker: int, *, core_version: Optional[str] = None
self, text: str, style_id: int, *, core_version: Optional[str] = None
) -> AudioQuery:
"""Create audio query
Expand All @@ -72,7 +72,7 @@ async def create_audio_query(
AudioQuery
Audio query, that run synthesis.
"""
params = {"text": text, "speaker": speaker}
params = {"text": text, "style_id": style_id}
if core_version is not None:
params["core_version"] = core_version
audio_query = await self.http.create_audio_query(params)
Expand Down

0 comments on commit 488986b

Please sign in to comment.