-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
Description
Fix inbound shortly, just a placeholder so I don't forget - but basically I think the import logic doesn't reflect the intent of allowing pwmio if audioio isn't available , since my QTPy-ESP32-S2 should be able to use this library with pwmio but the current import structure doesn't allow it. It seems like it should only tell the user to add adafruit_waveform if audioio is detected by adafruit_waveform is not based on the logic here:
Adafruit_CircuitPython_RTTTL/adafruit_rtttl.py
Lines 190 to 205 in 695e52c
| if AUDIOIO_AVAILABLE: | |
| wave, min_freq = _get_wave(tune, octave) | |
| try: | |
| # AudioOut interface changed in CP 3.x; a waveform if now pass | |
| # directly to .play(), generated for each note in _play_to_pin() | |
| if sys.implementation.version[0] >= 3: | |
| base_tone = audioio.AudioOut(pin) | |
| else: | |
| base_tone = audioio.AudioOut(pin, wave) | |
| except ValueError: | |
| # No DAC on the pin so use PWM. | |
| pass | |
| # Fall back to PWM | |
| if not base_tone: | |
| base_tone = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True) |