# Product question

**URL:** <https://forum.core-electronics.com.au/t/product-question/18292>\
**Category:** Finding Parts\
**Created:** [16 October 2023 00:27 UTC](https://forum.core-electronics.com.au/t/product-question/18292 "2023-10-16T00:27:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim250090](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Tim250090](https://forum.core-electronics.com.au/u/Tim250090)\
**Post date:** [16 October 2023 00:27 UTC](https://forum.core-electronics.com.au/t/product-question/18292/1 "2023-10-16T00:27:07Z")

</div>

Hi,  
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.

---

<div class="post-metadata">

**Author:** ![Murray125532](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/murray125532/32/6734_2.png) [@Murray125532](https://forum.core-electronics.com.au/u/Murray125532)\
**Post date:** [16 October 2023 01:09 UTC](https://forum.core-electronics.com.au/t/product-question/18292/2 "2023-10-16T01:09:35Z")

</div>

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

> **[Borg Cube for Scouts STEM Camp - Tutorial Australia](https://core-electronics.com.au/projects/borg-cube/)**
>
> Introduction What does one make for a Startrek-themed STEM camp for Scouts? Especially when given the Search and Rescue (SAR) activity base to run. 
> Why this base you ask? Usually I run a radio direction-finding activity since I am an amateur...

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)

```auto
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
sleep_ms(100)
uart.write("AT+AMP=ON\r\n")
sleep_ms(100)
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.)

Murray

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [16 October 2023 03:09 UTC](https://forum.core-electronics.com.au/t/product-question/18292/3 "2023-10-16T03:09:11Z")

</div>

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

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

> **[Raspberry Pi Pico (Without Headers)](https://core-electronics.com.au/raspberry-pi-pico.html)**
>
> Welcome to your Raspberry Pi Pico, the new flexible microcontroller board from Raspberry Pi.

> **[DFRobot DFPlayer PRO - A MP3 Player](https://core-electronics.com.au/dfrobot-dfplayer-pro-a-mp3-player.html)**
>
> Here comes the DFPlayer Pro---A mini simple but powerful MP3 Player! This MP3 player module supports four controlling modes: Arduino, AT command, on-board buttons...
