massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / wave.pyi
1 import sys
2 from _typeshed import Self
3 from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, Union
4
5 _File = Union[str, IO[bytes]]
6
7 class Error(Exception): ...
8
9 WAVE_FORMAT_PCM: int
10
11 class _wave_params(NamedTuple):
12     nchannels: int
13     sampwidth: int
14     framerate: int
15     nframes: int
16     comptype: str
17     compname: str
18
19 class Wave_read:
20     def __init__(self, f: _File) -> None: ...
21     def __enter__(self: Self) -> Self: ...
22     def __exit__(self, *args: Any) -> None: ...
23     def getfp(self) -> BinaryIO | None: ...
24     def rewind(self) -> None: ...
25     def close(self) -> None: ...
26     def tell(self) -> int: ...
27     def getnchannels(self) -> int: ...
28     def getnframes(self) -> int: ...
29     def getsampwidth(self) -> int: ...
30     def getframerate(self) -> int: ...
31     def getcomptype(self) -> str: ...
32     def getcompname(self) -> str: ...
33     def getparams(self) -> _wave_params: ...
34     def getmarkers(self) -> None: ...
35     def getmark(self, id: Any) -> NoReturn: ...
36     def setpos(self, pos: int) -> None: ...
37     def readframes(self, nframes: int) -> bytes: ...
38
39 class Wave_write:
40     def __init__(self, f: _File) -> None: ...
41     def __enter__(self: Self) -> Self: ...
42     def __exit__(self, *args: Any) -> None: ...
43     def setnchannels(self, nchannels: int) -> None: ...
44     def getnchannels(self) -> int: ...
45     def setsampwidth(self, sampwidth: int) -> None: ...
46     def getsampwidth(self) -> int: ...
47     def setframerate(self, framerate: float) -> None: ...
48     def getframerate(self) -> int: ...
49     def setnframes(self, nframes: int) -> None: ...
50     def getnframes(self) -> int: ...
51     def setcomptype(self, comptype: str, compname: str) -> None: ...
52     def getcomptype(self) -> str: ...
53     def getcompname(self) -> str: ...
54     def setparams(self, params: _wave_params) -> None: ...
55     def getparams(self) -> _wave_params: ...
56     def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ...
57     def getmark(self, id: Any) -> NoReturn: ...
58     def getmarkers(self) -> None: ...
59     def tell(self) -> int: ...
60     # should be any bytes-like object after 3.4, but we don't have a type for that
61     def writeframesraw(self, data: bytes) -> None: ...
62     def writeframes(self, data: bytes) -> None: ...
63     def close(self) -> None: ...
64
65 # Returns a Wave_read if mode is rb and Wave_write if mode is wb
66 def open(f: _File, mode: str | None = ...) -> Any: ...
67
68 if sys.version_info < (3, 9):
69     openfp = open