Added type hints to audiocore
This commit is contained in:
parent
2681bd52b5
commit
b26ee6c1f6
@ -101,7 +101,7 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| def deinit(self, ) -> Any:
|
||||
//| def deinit(self, ) -> None:
|
||||
//| """Deinitialises the AudioOut and releases any hardware resources for reuse."""
|
||||
//| ...
|
||||
//|
|
||||
@ -118,13 +118,13 @@ STATIC void check_for_deinit(audioio_rawsample_obj_t *self) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def __enter__(self, ) -> Any:
|
||||
//| def __enter__(self, ) -> RawSample:
|
||||
//| """No-op used by Context Managers."""
|
||||
//| ...
|
||||
//|
|
||||
// Provided by context manager helper.
|
||||
|
||||
//| def __exit__(self, ) -> Any:
|
||||
//| def __exit__(self, ) -> None:
|
||||
//| """Automatically deinitializes the hardware when exiting a context. See
|
||||
//| :ref:`lifetime-and-contextmanagers` for more info."""
|
||||
//| ...
|
||||
@ -136,7 +136,7 @@ STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *ar
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_rawsample___exit___obj, 4, 4, audioio_rawsample_obj___exit__);
|
||||
|
||||
//| sample_rate: Any = ...
|
||||
//| sample_rate: Optional(int) = ...
|
||||
//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).
|
||||
//| When the sample is looped, this can change the pitch output without changing the underlying
|
||||
//| sample. This will not change the sample rate of any active playback. Call ``play`` again to
|
||||
|
@ -91,7 +91,7 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| def deinit(self, ) -> Any:
|
||||
//| def deinit(self, ) -> None:
|
||||
//| """Deinitialises the WaveFile and releases all memory resources for reuse."""
|
||||
//| ...
|
||||
STATIC mp_obj_t audioio_wavefile_deinit(mp_obj_t self_in) {
|
||||
@ -107,13 +107,13 @@ STATIC void check_for_deinit(audioio_wavefile_obj_t *self) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def __enter__(self, ) -> Any:
|
||||
//| def __enter__(self, ) -> WaveFile:
|
||||
//| """No-op used by Context Managers."""
|
||||
//| ...
|
||||
//|
|
||||
// Provided by context manager helper.
|
||||
|
||||
//| def __exit__(self, ) -> Any:
|
||||
//| def __exit__(self, ) -> None:
|
||||
//| """Automatically deinitializes the hardware when exiting a context. See
|
||||
//| :ref:`lifetime-and-contextmanagers` for more info."""
|
||||
//| ...
|
||||
@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__);
|
||||
|
||||
//| sample_rate: Any = ...
|
||||
//| sample_rate: Optional(int) = ...
|
||||
//| """32 bit value that dictates how quickly samples are loaded into the DAC
|
||||
//| in Hertz (cycles per second). When the sample is looped, this can change
|
||||
//| the pitch output without changing the underlying sample."""
|
||||
@ -152,7 +152,7 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| bits_per_sample: Any = ...
|
||||
//| bits_per_sample: int = ...
|
||||
//| """Bits per sample. (read only)"""
|
||||
//|
|
||||
STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) {
|
||||
@ -168,7 +168,7 @@ const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj,
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
//| channel_count: Any = ...
|
||||
//| channel_count: int = ...
|
||||
//| """Number of audio channels. (read only)"""
|
||||
//|
|
||||
STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user