Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

After a few years of this project on hiatus, I'm back to trying to finish it.

I have an Adafruit Audio FX Mini Sound Board - WAV/OGG Trigger - 2MB Flash set up to run via UART with an Arduino Pro Mini. UG is grounded, and RX/TX are both going to the appropriate pins on the Pro Mini. As far as hardware is concerned, everything is the way it should be.

The Pro Mini needs to be able to command the FX board to play specific sound files, as well as adjust the volume. It needs to be able to do this without use of the serial monitor. Unfortunately, the only example for the Adafruit library uses the serial monitor, and I've not had any luck digging into the library to figure things out myself.

I am under the impression that
sfx.playTrack("TRACK001WAV");
would tell the FX board to find the WAV file named "TRACK001" and play it, but it doesn't seem to work. It's a total of 11 characters including the filetype.

Is there a list of commands for the Adafruit library readily available and/or are there any examples of using this board through the UART connection that doesn'trequire the use of the serial monitor?

THIS is the only working example I was able to find, and while it was good reference and proof the board can be controlled directly with an Arduino, my issues persist.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

The example code impies you should include the "." before the suffix.

You can find the library source here: https://github.com/adafruit/Adafruit_Soundboard_library

Dave

User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

dastels wrote: Mon Jun 05, 2023 7:41 pm The example code impies you should include the "." before the suffix.

You can find the library source here: https://github.com/adafruit/Adafruit_Soundboard_library

Dave
What do you mean by "suffix?" Do you mean before the "WAV" type designator? I don't see that stated anywhere, and in the single example I've found of someone successfully using UART with this family of FX soundboards, there is no "."

The example code doesn't help very much; it would be far more helpful to have an example of basic UART coding, without the use of the serial monitor.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

Yes, the "type designator". Technically, it's just the characters after the final period.

The information is mixed, in the menu app it says to include the period, other places say not to.

If you want to use the serial control directly, you can use SoftwareSerial like the menu example does, or (if your board has a second hardware Serial Port) Serial1. Or you can use the library that abstracts away the protocol details.

If you want to use the library, the menu example does a fine job of demonstrating it.

If you want to use the serial interface directly, look at the library code (i.e. https://github.com/adafruit/Adafruit_So ... dboard.cpp).

Dave

User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

I've looked at the code in the library and tried to implement it. It doesn't appear to work. That's why I'm here asking for assistance. Even for Adafruit, the documentation for this particular board is very lacking.

Let's take a different approach. I want an Arduino to tell an FX Mini, connected via UART, to play a track that is named "SOUND01.wav" as it appears in the FX mini's memory and then wait some delay. What is the proper syntax inside the loop to make it do so?

I believe it should be:

Code: Select all

sfx.playTrack("SOUND01 WAV");
delay (time);
but that does not appear to work, even though it follows the only actual UART example project I can find.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

There shouldn't be a space. Try "SOUND01WAV".

There isn't a wealth of information, partly because the firmware is proprietary and so there isn't source to examine to see how it works. Also, the more common usecase is to use the trigger inputs.

Dave

User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

Turns out my code and everything was fine; the FX board needed reflashed for some reason (not fun).

Code works fine, spaces in the name are fine, 11 characters, not 12.

The question is, what is the command to set volume to a specific level? From what I've been about to find, the volume on this board goes from 0 to 204. It (apparently) defaults to full volume when it turns on. The Adafruit library only contains volume up/down commands, changing the volume in steps of 2 ever time the command is run. This means that if you wanted to have the volume at its lowest audible volume, the command would have to be run ~100 times.

I'm assuming there's got to be some way to specify a volume level, but I can't find anything.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

Yes, it looks like vol +/- is all you get.

Dave

User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

So I just found out that this board interrupts the Arduino that's controlling it; the Arduino code halts until the sound has stopped playing. Is this the intended design, and if so, how is this board of any use?

Is there some super secret undocumented thing one has to do to allow an Arduino to trigger the FX board and continue running its program?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

In the library when you play a file, it waits for a line to come back from the audio chip that indicates success/failure. There's no indication of the timing of that... i.e. whether the line comes back after the sound completes.

If you really need non-blocking sound playing you could use the GPIO triggers and control them using digital pins on the controller.

Dave

User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

So basically, Adafruit is selling a product where UART control is a selling point, but is fundamentally useless, because the MCU controlling the product is held hostage by the product?

Is there a way to force that success/failure response or remove it from the library entirely?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

Sure, the library is open source at https://github.com/adafruit/Adafruit_Soundboard_library. Do what you want.

Dave

User avatar
Prop_Forge
 
Posts: 11
Joined: Sun Mar 01, 2015 3:24 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by Prop_Forge »

dastels wrote: Tue Jun 13, 2023 9:13 pm Sure, the library is open source at https://github.com/adafruit/Adafruit_Soundboard_library. Do what you want.

Dave
So this is the technical support we can expect from Adafruit and its employees?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control

Post by dastels »

You asked if there was a way to change the library.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”