#CircuitPython - MEMENTO - Python Program...

1 messages · Page 1 of 1 (latest)

formal harbor
#

Oh thanks for the tip about the modules on the download page! Hmm yeah and there they describe it as "Buzzer - play tones or alerts, or indicate when a photo was successfully taken", so maybe I can't play audio on this after all.

gaunt trellis
#

I'm not sure... I don't see any audio modules listed 😦 I don't do much audio work in CircuitPython so I don't have a good idea of alternatives :/ Sorry I can't help more.

formal harbor
#

Hey no problem, appreciate the response! I'll have to see if I can think of some alternative

#

Kind kills the project if I can't play the audio though haha

smoky imp
#
def tone(self, frequency, duration=0.1):
        """Play a tone on the internal speaker"""
        with pwmio.PWMOut(
            board.SPEAKER, frequency=int(frequency), variable_frequency=False
        ) as pwm:
            self.mute.value = True
            pwm.duty_cycle = 0x8000
            time.sleep(duration)
            self.mute.value = False
#

it uses pwmio.PWMOut

#

I'm not sure if the piezo speaker will do more than basic tones.

#

to use it simply do pycam.tone(200, 0.1)

#

it's in the example code on github while it snaps a picture it also beeps.```py
if pycam.mode_text == "JPEG":
pycam.tone(200, 0.1)
try:
pycam.display_message("Snap!", color=0x0000FF)
pycam.capture_jpeg()
pycam.live_preview_mode()
except TypeError as e:
pycam.display_message("Failed", color=0xFF0000)
time.sleep(0.5)
pycam.live_preview_mode()
except RuntimeError as e:
pycam.display_message("Error\nNo SD Card", color=0xFF0000)
time.sleep(0.5)

formal harbor
#

Yeah I saw that part, I was hoping it could also handle the mp3 output but it doesn't seem that is the case so far

#

Thanks for the pointers!

smoky imp
#

esp32-s3 doesn't have MP3 capability. it would require a DAC and the chip doesn't have one. You could add an external DAC using stemma i2c and I2S amplifier. It's possible, just not built into the board.