File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import io
44import subprocess
5- from typing import Iterator , Union
5+ from typing import Iterable , Union
66
77from ..exceptions import DependencyError
88
@@ -17,7 +17,7 @@ def _is_installed(command: str) -> bool:
1717
1818
1919def 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
Original file line number Diff line number Diff line change 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:
You can’t perform that action at this time.
0 commit comments