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

Change speaker to style_id #54

Merged
merged 3 commits into from
Dec 26, 2023
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
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
Loading