microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
41 stars 22 forks source link

`return_pin` for `audio.play()` throws an error by design, but should ignore it #181

Closed microbit-carlos closed 2 months ago

microbit-carlos commented 3 months ago

For out-of-the-box compatibility with V1 code the V2 implementation of audio.play(return_pin=...) should ignore the value instead of throwing an error:

>>> audio.play(audio.AudioFrame(), return_pin=pin2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: return_pin not supported
>>> 

This is also what we've documented in https://microbit-micropython.readthedocs.io/en/v2-docs/audio.html#audio.play .

dpgeorge commented 2 months ago

Fixed by 15b467c44936b532fac529b810bdfcbba4dfb307