Skip to content

Commit 3d1e005

Browse files
committed
Added type hints to audioio
1 parent b26ee6c commit 3d1e005

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

shared-bindings/audioio/AudioOut.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar
111111
return MP_OBJ_FROM_PTR(self);
112112
}
113113

114-
//| def deinit(self, ) -> Any:
114+
//| def deinit(self, ) -> None:
115115
//| """Deinitialises the AudioOut and releases any hardware resources for reuse."""
116116
//| ...
117117
//|
@@ -127,13 +127,13 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) {
127127
raise_deinited_error();
128128
}
129129
}
130-
//| def __enter__(self, ) -> Any:
130+
//| def __enter__(self, ) -> AudioOut:
131131
//| """No-op used by Context Managers."""
132132
//| ...
133133
//|
134134
// Provided by context manager helper.
135135

136-
//| def __exit__(self, ) -> Any:
136+
//| def __exit__(self, ) -> None:
137137
//| """Automatically deinitializes the hardware when exiting a context. See
138138
//| :ref:`lifetime-and-contextmanagers` for more info."""
139139
//| ...
@@ -146,7 +146,7 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg
146146
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__);
147147

148148

149-
//| def play(self, sample: Any, *, loop: Any = False) -> Any:
149+
//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None:
150150
//| """Plays the sample once when loop=False and continuously when loop=True.
151151
//| Does not block. Use `playing` to block.
152152
//|
@@ -175,7 +175,7 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg
175175
}
176176
MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play);
177177

178-
//| def stop(self, ) -> Any:
178+
//| def stop(self, ) -> None:
179179
//| """Stops playback and resets to the start of the sample."""
180180
//| ...
181181
//|
@@ -187,7 +187,7 @@ STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) {
187187
}
188188
MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_stop_obj, audioio_audioout_obj_stop);
189189

190-
//| playing: Any = ...
190+
//| playing: bool = ...
191191
//| """True when an audio sample is being output even if `paused`. (read-only)"""
192192
//|
193193
STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) {
@@ -204,7 +204,7 @@ const mp_obj_property_t audioio_audioout_playing_obj = {
204204
(mp_obj_t)&mp_const_none_obj},
205205
};
206206

207-
//| def pause(self, ) -> Any:
207+
//| def pause(self, ) -> None:
208208
//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback."""
209209
//| ...
210210
//|
@@ -220,7 +220,7 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) {
220220
}
221221
MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause);
222222

223-
//| def resume(self, ) -> Any:
223+
//| def resume(self, ) -> None:
224224
//| """Resumes sample playback after :py:func:`pause`."""
225225
//| ...
226226
//|
@@ -236,7 +236,7 @@ STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) {
236236
}
237237
MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_resume_obj, audioio_audioout_obj_resume);
238238

239-
//| paused: Any = ...
239+
//| paused: bool = ...
240240
//| """True when playback is paused. (read-only)"""
241241
//|
242242
STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) {

0 commit comments

Comments
 (0)