Thanks to visit codestin.com
Credit goes to github.com

Skip to content

not compatible with CP 3.0 audioio API #8

Closed
@jerryneedell

Description

@jerryneedell

this line causes an error under CP3.0 because of an API change.
https://github.com/adafruit/Adafruit_CircuitPython_RTTTL/blob/master/adafruit_rtttl.py#L170

Adafruit CircuitPython 3.0.0-alpha.6-143-g990da6d on 2018-05-19; Adafruit CircuitPlayground Express with samd21g18
>>> 
>>> import rttl_example
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "rttl_example.py", line 33, in <module>
  File "adafruit_rtttl.py", line 173, in play
  File "adafruit_rtttl.py", line 170, in play
TypeError: extra positional arguments given
>>> 

test code


import adafruit_rtttl
import digitalio
import board

enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
enable.switch_to_output(value=True)

adafruit_rtttl.play(board.SPEAKER, "itchy:d=8,o=6,b=160:c,a5,4p,c,a,4p,c,a5,c,a5," + \
    "c,a,4p,p,c,d,e,p,e,f,g,4p,d,c,4d,f,4a#,4a,2c7")
adafruit_rtttl.play(board.SPEAKER, "Phantom:d=4,o=5,b=140:c,f,c,d#.,8c#,2c#,a#4," + \
    "d#,8a#4,2c,c,f,c,d#.,8c#,2c#,a#4,d#.,8a#4,2c,p,c,f,g#,c.6,8a#,2a#,a#,d#.6,8a#," + \
    "2c6,p,c6,2f.6,8d#6,8c#6,8c6,8a#,8g#,8g,8f,2e,c#,c#.,8c,2c")


Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions