Adafruit STEMMA Speaker encoding settings

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
tom2021
 
Posts: 49
Joined: Tue Dec 28, 2021 9:07 am

Adafruit STEMMA Speaker encoding settings

Post by tom2021 »

With the Adafruit STEMMA Speaker what are the max and min encoding settings for mp3 and wav files using CircuitPython?

.wav:
Mix: Mono
Rate: Hz
Format: PCM

.mp3:
Mix: Mono
Rate: Hz
Format: PCM
Quality: Kbps

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit STEMMA Speaker encoding settings

Post by mikeysklar »

The encoding limitations will be tied to the controller board you are using and platform it is running.

eg. Feather M4 vs Arduino UNO 328
eg. CircuitPython vs Arduino

So a specific example would be CircuitPython on a Circuit Playground Express (M0) board when using the stemma speaker:
A sample rate less than or equal to 22,050 hertz
16-bit
mono / single channel
https://learn.adafruit.com/make-it-soun ... -2996037-8

MP3's on CircuitPython:
CircuitPython supports any MP3 file you like. We've found that mono and stereo files from 32kbit/s to 128kbit/s work, with sample rates from 16kHz to 44.1kHz.
https://learn.adafruit.com/circuitpytho ... -mp3-audio

User avatar
tom2021
 
Posts: 49
Joined: Tue Dec 28, 2021 9:07 am

Re: Adafruit STEMMA Speaker encoding settings

Post by tom2021 »

mikeysklar wrote: MP3's on CircuitPython:
CircuitPython supports any MP3 file you like. We've found that mono and stereo files from 32kbit/s to 128kbit/s work, with sample rates from 16kHz to 44.1kHz.
https://learn.adafruit.com/circuitpytho ... -mp3-audio
Thanks mate.

Is it possible to connect one of the following stereo amplifiers to a Adafruit Grand Central M4 Express pin A0? An RGBMatrix is already taking up the clock pins and I have another device on SDA/SCL but from what I read I might be able to connect multiple devices to SDA/SCL pins. I have NeoPixels connected to SPI.

No need to change the sound levels, just send stereo mp3 audio from microcontroller A0 pin to the amplifier. I'm using the STEMMA Speaker but unfortunately the audio on the speaker doesn't output the audio I've selected well.
Also, do amplifiers remember the sound level it was set when turned off?

Stereo 20W Class D Audio Amplifier - MAX9744
Stereo 2.1W Class D Audio Amplifier - TPA2012
Stereo 3.7W Class D Audio Amplifier - MAX98306
Stereo 2.8W Class D Audio Amplifier - I2C Control AGC - TPA2016

If stereo is not an option happy to look at mono.

User avatar
tom2021
 
Posts: 49
Joined: Tue Dec 28, 2021 9:07 am

Re: Adafruit STEMMA Speaker encoding settings

Post by tom2021 »

Hi, is it possible to connect the following stereo amplifier to the Adafruit Grand Central M4 Express pin A0?

I am not sure my wiring is correct, anyone have experience to check it over?

Parts:
Speaker - 3" Diameter - 4 Ohm 3 Watt
Stereo 2.1W Class D Audio Amplifier - TPA2012
Alpha Dual-Gang 16mm Right-angle PC Mount - 50K Audio - RV16A01F-41-15R1-50K-30H4
Adafruit Grand Central M4 Express
Solid Machined Metal Knob - 1 Diameter

Questions:
- Will the amplifier remember the sound volume when turned off and on again?
- Is the 50k potentiometer sufficient to control the volume?
- The wires from the speaker to the amplifier will be around 25-30cm. This amplifier is designed for use without an output filter, when wires are kept at under 2"-4" long. Does Adafruit sell an output filter, what is the best way to include it?
- The Adafruit Grand Central is 3V logic is this okay or do I need a level shifter? Would this level shifter be okay if needed? Also, we recommend analog inputs only. If you have a PWM (1-bit DAC) signals, use a filter to get them to analog level

I’m not sure my wiring is correct so I’ve included an image up to the point I know it is correct as well as what I think it should be.
wiring.png
wiring.png (653.05 KiB) Viewed 182 times
wiring1.png
wiring1.png (650.78 KiB) Viewed 182 times

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit STEMMA Speaker encoding settings

Post by mikeysklar »

You can use the A0 pin on a the Adafruit Grand Central M4 to play stereo files. There is actually a guide for this.

https://learn.adafruit.com/circuitpytho ... -mp3-audio
CircuitPython supports any MP3 file you like. We've found that mono and stereo files from 32kbit/s to 128kbit/s work, with sample rates from 16kHz to 44.1kHz. The DAC output on the SAMD51 M4 is just 12-bit so there's not much point in using higher bitrates.
There are some wiring examples that are using an RP2040 Pico and PAM8302 amp which might be a helpful guide. In these cases they are playing mono or stereo files, but only through a single speaker output.

https://learn.adafruit.com/mp3-playback-rp2040?view=all

If you have further specific questions please start another thread as we are well off the "stemma speaker" topic.

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

Return to “Other Products from Adafruit”