Skip to content

Commit 5240b45

Browse files
committed
refactor: update type hints to use Iterable instead of Iterator for audio parameters
1 parent eb7abc9 commit 5240b45

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/fishaudio/utils/play.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import io
44
import subprocess
5-
from typing import Iterator, Union
5+
from typing import Iterable, Union
66

77
from ..exceptions import DependencyError
88

@@ -17,7 +17,7 @@ def _is_installed(command: str) -> bool:
1717

1818

1919
def play(
20-
audio: Union[bytes, Iterator[bytes]],
20+
audio: Union[bytes, Iterable[bytes]],
2121
*,
2222
notebook: bool = False,
2323
use_ffmpeg: bool = True,
@@ -26,7 +26,7 @@ def play(
2626
Play audio using various playback methods.
2727
2828
Args:
29-
audio: Audio bytes or iterator of bytes
29+
audio: Audio bytes or iterable of bytes
3030
notebook: Use Jupyter notebook playback (IPython.display.Audio)
3131
use_ffmpeg: Use ffplay for playback (default, falls back to sounddevice)
3232

src/fishaudio/utils/save.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""Audio saving utility."""
22

3-
from typing import Iterator, Union
3+
from typing import Iterable, Union
44

55

6-
def save(audio: Union[bytes, Iterator[bytes]], filename: str) -> None:
6+
def save(audio: Union[bytes, Iterable[bytes]], filename: str) -> None:
77
"""
88
Save audio to a file.
99
1010
Args:
11-
audio: Audio bytes or iterator of bytes
11+
audio: Audio bytes or iterable of bytes
1212
filename: Path to save the audio file
1313
1414
Examples:

0 commit comments

Comments
 (0)