Closed microbit-carlos closed 2 months ago
I have changed the code to ensure that the size is always at least 32 bytes.
Great, thanks Damien!
I have changed the code to ensure that the size is always at least 32 bytes.
Using a small duration
or rate
can still create an AudioFrame
with less than 32 bytes:
>>> len(AudioFrame(1000, 1))
1
>>> len(AudioFrame(1, 1))
1
>>>
Using a small
duration
orrate
can still create anAudioFrame
with less than 32 bytes:
This is intended.
Now that the code supports arbitrary byte lengths (ie no longer a multiple of 32), it's possible to create frames all the way down to 1 byte in size.
Sounds good, thanks Damien!
Likely the integer division flooring (well, rounding towards zero) from: https://github.com/microbit-foundation/micropython-microbit-v2/blob/c91ae4e83c5a1a82f647740277f7d4a462192160/src/codal_port/modaudio.c#L334