summaryrefslogtreecommitdiff
path: root/shared-bindings/audiocore/WaveFile.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-07-22 13:48:45 -0700
committerGitHub <noreply@github.com>2020-07-22 13:48:45 -0700
commit02b71e013adda29cd67172a3782fda8fa5da0bba (patch)
tree4a0230aa6e19e9392908e1b23e83f5e9a4d93128 /shared-bindings/audiocore/WaveFile.c
parent05a10f7905bfb77f3d5dff2525c9d10375801329 (diff)
parent9e3fa863f1d0dcf8eae54554ffc7016eaa6de157 (diff)
Merge pull request #3107 from dherrada/type_hints
Adding type hints
Diffstat (limited to 'shared-bindings/audiocore/WaveFile.c')
-rw-r--r--shared-bindings/audiocore/WaveFile.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c
index a067f6cda..d986d6db5 100644
--- a/shared-bindings/audiocore/WaveFile.c
+++ b/shared-bindings/audiocore/WaveFile.c
@@ -40,7 +40,7 @@
//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating
//| an internal buffer."""
//|
-//| def __init__(self, file: typing.BinaryIO, buffer: bytearray):
+//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer) -> None:
//| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`.
//|
//| :param typing.BinaryIO file: Already opened wave file
@@ -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: 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) {