Product question

I’m after a triggerable audio player for an interactive display.
The audio player will be triggered by an external device to play prerecorded sounds from a USB for a set period of time, eg 10-15 seconds.
What do you recommend as the triggerable audio player.

hi @Tim250090

I would use this, unless you need to be able to replace the sound on the external USB occasionally

It is otherwise self contained

An extract from my Borg Cube Project

The UART, a control ‘array’, and string concatenation
The UART on the Pico is used to control the DFRobot MP3 Player (DFR0768) for the ‘Borg-ish’ announcements. I have a trigger system based on the PiicoDev Capacitive Touch Sensor (CE07816), and a random audio effect, selected from the 7 available tracks. Each track has a unique duration, which has to be used to lock-out retriggering so that each track can play to completion.

The duration is stored in a python list, the choice of track number is random, and this number has to be concatenated into the control string – i.e. as a text character – and also used in the lockout timer – as a numeric value that is the index for the duration entry.

This is what I developed (after a lot of Googling for the simplest integer-to-ascii conversion)

from machine import Pin, UART
from PiicoDev_Unified import sleep_ms
import random

uart - UART(0, baudrate=115200, tx=Pin(12), rx=Pin(13))

durations = [0, 17, 10, 2, 2, 6, 2, 3 ]    # runtime + 1 second, no track 0

uart.write("AT\r\n")        # wakeup
uart.write("AT+PLAYMODE=3\r\n")    # single track mode

# play 10 random noises
for i in range(10):
    play = random.randint(1,7)          # pick a track 1 - 7 
    print("playing track ", play)       # show me
    c_num = "% s" % play                #   / itoa()
    s = "AT+PLAYNUM=" + c_num + "\r\n"  #  / build DFRobot command
    uart.write(s)                       # / and send it
    sleep_ms(durations[play]*1000)      # zzzzz

Bottom line: works as planned. (p.s. The DFRobot MP3 Player (DFR0768) has both its onboard amplifier which can drive 8 ohm speakers directly which is great for testing, and the actual DAC outputs can be fed straight into an external power amplifier.)


1 Like

Cheers for providing this info Murray! Your projects just keep on giving :slight_smile:

And for Tim, here’s the products Murray is referring to: