summaryrefslogtreecommitdiffstats
path: root/venv/Lib/site-packages/pygame/mixer.pyi
blob: b05a5b1fc67144bfe6110a47e9c12b9731ef3f4b (plain)
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
82
83
84
from typing import Optional, Union, Tuple, Any, overload, IO

if sys.version_info >= (3, 6):
    from os import PathLike
    AnyPath = Union[str, bytes, PathLike[str], PathLike[bytes]]
else:
    AnyPath = Union[Text, bytes]

from pygame.event import Event
from . import music as music
import numpy

def init(
    frequency: Optional[int] = 44100,
    size: Optional[int] = -16,
    channels: Optional[int] = 2,
    buffer: Optional[int] = 512,
    devicename: Optional[Union[str, None]] = None,
    allowedchanges: Optional[int] = 5,
) -> None: ...
def pre_init(
    frequency: Optional[int] = 44100,
    size: Optional[int] = -16,
    channels: Optional[int] = 2,
    buffer: Optional[int] = 512,
    devicename: Optional[Union[str, None]] = None,
) -> None: ...
def quit() -> None: ...
def get_init() -> Tuple[int, int, int]: ...
def stop() -> None: ...
def pause() -> None: ...
def unpause() -> None: ...
def fadeout(time: int) -> None: ...
def set_num_channels(count: int) -> None: ...
def get_num_channels() -> int: ...
def set_reserved() -> None: ...
def find_channel(force: bool) -> Channel: ...
def get_busy() -> bool: ...
def get_sdl_mixer_version(linked: bool) -> Tuple[int, int, int]: ...

class Sound:
    @overload
    def __init__(self, file: Union[AnyPath, IO]) -> None: ...
    @overload
    def __init__(self, buffer: Any) -> None: ...  # Buffer protocol is still not implemented in typing
    @overload
    def __init__(self, array: numpy.ndarray) -> None: ...  # Buffer protocol is still not implemented in typing
    def play(
        self,
        loops: Optional[int] = 0,
        maxtime: Optional[int] = 0,
        fade_ms: Optional[int] = 0,
    ) -> Channel: ...
    def stop(self) -> None: ...
    def fadeout(self, time: int) -> None: ...
    def set_volume(self, value: float) -> None: ...
    def get_volume(self) -> float: ...
    def get_num_channels(self) -> int: ...
    def get_length(self) -> float: ...
    def get_raw(self) -> bytes: ...

class Channel:
    def __init__(self, id: int) -> None: ...
    def play(
        self,
        sound: Sound,
        loops: Optional[int] = 0,
        maxtime: Optional[int] = 0,
        fade_ms: Optional[int] = 0,
    ) -> None: ...
    def stop(self) -> None: ...
    def pause(self) -> None: ...
    def unpause(self) -> None: ...
    def fadeout(self, time: int) -> None: ...
    @overload
    def set_volume(self, value: float) -> None: ...
    @overload
    def set_volume(self, left: float, right: float) -> None: ...
    def get_volume(self) -> float: ...
    def get_busy(self) -> bool: ...
    def get_sound(self) -> Sound: ...
    def get_queue(self) -> Sound: ...
    def set_endevent(self, type: Optional[Union[int, Event]] = None) -> None: ...
    def get_endevent(self) -> int: ...