Skip to content

Commit

Permalink
feat(playht): add Play3.0-mini engine support (livekit#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
imsakg authored Nov 27, 2024
1 parent 415b07a commit 7b601b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-suns-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-playht": patch
---

feat(playht): add Play3.0-mini engine support
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from typing import Literal

TTSEngines = Literal["PlayHT2.0", "PlayHT1.0", "PlayHT2.0-turbo"]
TTSEngines = Literal[
"PlayHT2.0",
"PlayHT1.0",
"PlayHT2.0-turbo",
"Play3.0-mini",
]

TTSEncoding = Literal[
"mp3_22050_32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def _encoding_from_format(output_format: TTSEncoding) -> _Encoding:
return "mp3"
elif output_format.startswith("pcm"):
return "pcm"
elif output_format.startswith("wav"):
return "pcm"

raise ValueError(f"Unknown format: {output_format}")

Expand All @@ -46,7 +48,7 @@ class Voice:
DEFAULT_VOICE = Voice(
id="s3://peregrine-voices/mel22/manifest.json",
name="Will",
voice_engine="PlayHT2.0",
voice_engine="Play3.0-mini",
)

ACCEPT_HEADER = {
Expand Down

0 comments on commit 7b601b6

Please sign in to comment.