Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies = [
"ormsgpack>=1.5.0",
"pydantic>=2.9.1",
"httpx-ws>=0.6.2",
"typing-extensions>=4.15.0",
]
requires-python = ">=3.9"
readme = "README.md"
Expand Down Expand Up @@ -55,6 +56,7 @@ asyncio_mode = "auto"

[dependency-groups]
dev = [
"fish-audio-sdk[utils]",
"mypy>=1.14.1",
Comment thread
twangodev marked this conversation as resolved.
Outdated
"pydoc-markdown>=4.8.2",
"pytest>=8.3.5",
Expand All @@ -63,6 +65,7 @@ dev = [
"pytest-rerunfailures>=16.0.1",
"python-dotenv>=1.0.1",
"ruff>=0.14.3",
"ty>=0.0.2",
Comment thread
twangodev marked this conversation as resolved.
]

[[tool.pydoc-markdown.loaders]]
Expand All @@ -80,3 +83,6 @@ pages = [
{title = "Utils", name="fishaudio/utils", contents = ["fishaudio.utils.*"] },
{title = "Exceptions", name="fishaudio/exceptions", contents = ["fishaudio.exceptions.*"] },
]

[tool.uv.sources]
fish-audio-sdk = { workspace = true }
4 changes: 2 additions & 2 deletions src/fish_audio_sdk/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
AsyncGenerator,
Awaitable,
Callable,
Concatenate,
Generator,
Generic,
ParamSpec,
TypeVar,
)

from typing_extensions import Concatenate, ParamSpec

import httpx
import httpx._client
import httpx._types
Expand Down
4 changes: 2 additions & 2 deletions src/fishaudio/utils/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ def play(
```
"""
# Consolidate iterator to bytes
if isinstance(audio, Iterator):
if not isinstance(audio, bytes):
Comment thread
twangodev marked this conversation as resolved.
audio = b"".join(audio)
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Notebook mode
if notebook:
try:
from IPython.display import Audio, display
from IPython.display import Audio, display # ty: ignore[unresolved-import]
Comment thread
twangodev marked this conversation as resolved.

display(Audio(audio, rate=44100, autoplay=True))
return
Expand Down
2 changes: 1 addition & 1 deletion src/fishaudio/utils/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def save(audio: Union[bytes, Iterator[bytes]], filename: str) -> None:
```
"""
# Consolidate iterator to bytes if needed
if isinstance(audio, Iterator):
if not isinstance(audio, bytes):
Comment thread
twangodev marked this conversation as resolved.
audio = b"".join(audio)

# Write to file
Expand Down
31 changes: 31 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading