Skip to content

Commit 2681bd5

Browse files
committed
Did audiobusio
1 parent 427733a commit 2681bd5

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

shared-bindings/audiobusio/I2SOut.c

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

115-
//| def deinit(self, ) -> Any:
115+
//| def deinit(self, ) -> None:
116116
//| """Deinitialises the I2SOut and releases any hardware resources for reuse."""
117117
//| ...
118118
//|
@@ -128,13 +128,13 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) {
128128
raise_deinited_error();
129129
}
130130
}
131-
//| def __enter__(self, ) -> Any:
131+
//| def __enter__(self, ) -> I2SOut:
132132
//| """No-op used by Context Managers."""
133133
//| ...
134134
//|
135135
// Provided by context manager helper.
136136

137-
//| def __exit__(self, ) -> Any:
137+
//| def __exit__(self, ) -> None:
138138
//| """Automatically deinitializes the hardware when exiting a context. See
139139
//| :ref:`lifetime-and-contextmanagers` for more info."""
140140
//| ...
@@ -147,7 +147,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar
147147
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__);
148148

149149

150-
//| def play(self, sample: Any, *, loop: Any = False) -> Any:
150+
//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: Any = False) -> None:
151151
//| """Plays the sample once when loop=False and continuously when loop=True.
152152
//| Does not block. Use `playing` to block.
153153
//|
@@ -174,7 +174,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar
174174
}
175175
MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play);
176176

177-
//| def stop(self, ) -> Any:
177+
//| def stop(self, ) -> None:
178178
//| """Stops playback."""
179179
//| ...
180180
//|
@@ -186,7 +186,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) {
186186
}
187187
MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop);
188188

189-
//| playing: Any = ...
189+
//| playing: bool = ...
190190
//| """True when the audio sample is being output. (read-only)"""
191191
//|
192192
STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) {
@@ -203,7 +203,7 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = {
203203
(mp_obj_t)&mp_const_none_obj},
204204
};
205205

206-
//| def pause(self, ) -> Any:
206+
//| def pause(self, ) -> None:
207207
//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback."""
208208
//| ...
209209
//|
@@ -219,7 +219,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) {
219219
}
220220
MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause);
221221

222-
//| def resume(self, ) -> Any:
222+
//| def resume(self, ) -> None:
223223
//| """Resumes sample playback after :py:func:`pause`."""
224224
//| ...
225225
//|
@@ -235,7 +235,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) {
235235
}
236236
MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume);
237237

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

shared-bindings/audiobusio/PDMIn.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar
134134
return MP_OBJ_FROM_PTR(self);
135135
}
136136

137-
//| def deinit(self, ) -> Any:
137+
//| def deinit(self, ) -> None:
138138
//| """Deinitialises the PDMIn and releases any hardware resources for reuse."""
139139
//| ...
140140
//|
@@ -150,13 +150,13 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) {
150150
raise_deinited_error();
151151
}
152152
}
153-
//| def __enter__(self, ) -> Any:
153+
//| def __enter__(self, ) -> PDMIn:
154154
//| """No-op used by Context Managers."""
155155
//| ...
156156
//|
157157
// Provided by context manager helper.
158158

159-
//| def __exit__(self, ) -> Any:
159+
//| def __exit__(self, ) -> None:
160160
//| """Automatically deinitializes the hardware when exiting a context."""
161161
//| ...
162162
//|
@@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg
168168
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__);
169169

170170

171-
//| def record(self, destination: Any, destination_length: Any) -> Any:
171+
//| def record(self, destination: bytearray, destination_length: int) -> None:
172172
//| """Records destination_length bytes of samples to destination. This is
173173
//| blocking.
174174
//|
@@ -210,7 +210,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat
210210
}
211211
MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record);
212212

213-
//| sample_rate: Any = ...
213+
//| sample_rate: int = ...
214214
//| """The actual sample_rate of the recording. This may not match the constructed
215215
//| sample rate due to internal clock limitations."""
216216
//|

0 commit comments

Comments
 (0)