forked from tuxu/python-samplerate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsamplerate.pyi
More file actions
81 lines (74 loc) · 2.29 KB
/
samplerate.pyi
File metadata and controls
81 lines (74 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from typing import Optional, Union, Callable, Iterator, Tuple, overload, TypedDict
import numpy as np
import numpy.typing as npt
class BuildInfo(TypedDict):
version: str
libsamplerate_version: str
build_type: str
compiler_id: str
compiler_version: str
cmake_version: str
target_arch: str
target_os: str
pybind11_version: str
cpp_standard: str
lto_enabled: bool
pointer_size_bits: int
float_size_bytes: int
gil_release_threshold: int
class ConverterType:
sinc_best: int
sinc_medium: int
sinc_fastest: int
zero_order_hold: int
linear: int
class ResamplingError(RuntimeError): ...
def set_gil_release_threshold(threshold: int) -> None: ...
def get_gil_release_threshold() -> int: ...
def get_build_info() -> BuildInfo: ...
def resample(
input_data: npt.NDArray[np.float32],
ratio: float,
converter_type: Union[ConverterType, str, int] = "sinc_best",
verbose: bool = False,
release_gil: Optional[Union[bool, str]] = None,
) -> npt.NDArray[np.float32]: ...
class Resampler:
converter_type: int
channels: int
def __init__(
self,
converter_type: Union[ConverterType, str, int] = "sinc_best",
channels: int = 1,
) -> None: ...
def process(
self,
input_data: npt.NDArray[np.float32],
ratio: float,
end_of_input: bool = False,
release_gil: Optional[Union[bool, str]] = None,
) -> npt.NDArray[np.float32]: ...
def reset(self) -> None: ...
def set_ratio(self, new_ratio: float) -> None: ...
def clone(self) -> "Resampler": ...
class CallbackResampler:
ratio: float
converter_type: int
channels: int
def __init__(
self,
callback: Callable[[], Optional[npt.NDArray[np.float32]]],
ratio: float,
converter_type: Union[ConverterType, str, int] = "sinc_best",
channels: int = 1,
) -> None: ...
def read(
self,
num_frames: int,
release_gil: Optional[Union[bool, str]] = None,
) -> npt.NDArray[np.float32]: ...
def reset(self) -> None: ...
def set_starting_ratio(self, new_ratio: float) -> None: ...
def clone(self) -> "CallbackResampler": ...
def __enter__(self) -> "CallbackResampler": ...
def __exit__(self, exc_type, exc, exc_tb) -> None: ...