Debian Codegraph @

jedi/third_party/typeshed/stdlib/aifc.pyi

raw symbols SCIP
1 from types import TracebackType
2 from typing import IO, Any, Literal, NamedTuple, overload
3 from typing_extensions import Self, TypeAlias
4
5 __all__ = ["Error", "open"]
6
7 class Error(Exception): ...
8
9 class _aifc_params(NamedTuple):
10 nchannels: int
11 sampwidth: int
12 framerate: int
13 nframes: int
14 comptype: bytes
15 compname: bytes
16
17 _File: TypeAlias = str | IO[bytes]
18 _Marker: TypeAlias = tuple[int, int, bytes]
19
20 class Aifc_read:
21 def __init__(self, f: _File) -> None: ...
22 def __enter__(self) -> Self: ...
23 def __exit__(
24 self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
25 ) -> None: ...
26 def initfp(self, file: IO[bytes]) -> None: ...
27 def getfp(self) -> IO[bytes]: ...
28 def rewind(self) -> None: ...
29 def close(self) -> None: ...
30 def tell(self) -> int: ...
31 def getnchannels(self) -> int: ...
32 def getnframes(self) -> int: ...
33 def getsampwidth(self) -> int: ...
34 def getframerate(self) -> int: ...
35 def getcomptype(self) -> bytes: ...
36 def getcompname(self) -> bytes: ...
37 def getparams(self) -> _aifc_params: ...
38 def getmarkers(self) -> list[_Marker] | None: ...
39 def getmark(self, id: int) -> _Marker: ...
40 def setpos(self, pos: int) -> None: ...
41 def readframes(self, nframes: int) -> bytes: ...
42
43 class Aifc_write:
44 def __init__(self, f: _File) -> None: ...
45 def __del__(self) -> None: ...
46 def __enter__(self) -> Self: ...
47 def __exit__(
48 self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
49 ) -> None: ...
50 def initfp(self, file: IO[bytes]) -> None: ...
51 def aiff(self) -> None: ...
52 def aifc(self) -> None: ...
53 def setnchannels(self, nchannels: int) -> None: ...
54 def getnchannels(self) -> int: ...
55 def setsampwidth(self, sampwidth: int) -> None: ...
56 def getsampwidth(self) -> int: ...
57 def setframerate(self, framerate: int) -> None: ...
58 def getframerate(self) -> int: ...
59 def setnframes(self, nframes: int) -> None: ...
60 def getnframes(self) -> int: ...
61 def setcomptype(self, comptype: bytes, compname: bytes) -> None: ...
62 def getcomptype(self) -> bytes: ...
63 def getcompname(self) -> bytes: ...
64 def setparams(self, params: tuple[int, int, int, int, bytes, bytes]) -> None: ...
65 def getparams(self) -> _aifc_params: ...
66 def setmark(self, id: int, pos: int, name: bytes) -> None: ...
67 def getmark(self, id: int) -> _Marker: ...
68 def getmarkers(self) -> list[_Marker] | None: ...
69 def tell(self) -> int: ...
70 def writeframesraw(self, data: Any) -> None: ... # Actual type for data is Buffer Protocol
71 def writeframes(self, data: Any) -> None: ...
72 def close(self) -> None: ...
73
74 @overload
75 def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ...
76 @overload
77 def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ...
78 @overload
79 def open(f: _File, mode: str | None = None) -> Any: ...