Skip to content
Closed
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ drama_audio = client.tts.convert(
text="Expressive speech",
model="drama-3",
)

# S3 Pro
s3_audio = client.tts.convert(
text="S3 Pro speech",
model="s3-pro",
)
```

**With custom voice:**
Expand Down
2 changes: 1 addition & 1 deletion src/fishaudio/types/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PaginatedResponse(BaseModel, Generic[T]):


# Model types
Model = Literal["s1", "s2-pro", "s2.1-pro", "s2.1-pro-free", "drama-3"]
Model = Literal["s1", "s2-pro", "s2.1-pro", "s2.1-pro-free", "drama-3", "s3-pro"]

# Deprecated models
DEPRECATED_MODELS = {"speech-1.5", "speech-1.6"}
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ def test_convert_with_drama_3(self, tts_client, mock_client_wrapper):
call_args = mock_client_wrapper.request.call_args
assert call_args[1]["headers"]["model"] == "drama-3"

def test_convert_with_s3_pro(self, tts_client, mock_client_wrapper):
"""Test the s3-pro model is sent as the model header."""
mock_response = Mock()
mock_response.iter_bytes.return_value = iter([b"audio"])
mock_client_wrapper.request.return_value = mock_response

audio = tts_client.convert(text="Hello world", model="s3-pro")

assert audio == b"audio"
call_args = mock_client_wrapper.request.call_args
assert call_args[1]["headers"]["model"] == "s3-pro"

def test_convert_with_reference_id(self, tts_client, mock_client_wrapper):
"""Test TTS with reference voice ID."""
mock_response = Mock()
Expand Down