Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mixing audio from SD and from bluetooth sources #2182

Answered by pschatzmann
AcuarioCat asked this question in Q&A
Discussion options

For my project I would like to achieve the following:

  • A music source from an SD card that plays all songs from a (or several) directory on the SD
  • An occasional announcement that comes from a bluetooth source that can either interrupt or mix with the music.

I have the code running for the SD card music source using an ESP32-S3 but now would like to add the bluetooth source.
Firstly, which version of ESP32? I gather the S3 which has PSRAM does not support A2DP.
The ESP32-audioI2S says it only works on boards with PSRAM so which ESP32 board do I need?

Alternatively I guess I could use an external bluetooth board that has an I2S output and feed that to the ESP32.

Then what about mixing or selecting the source to pipe to the output?
Is it possible to detect when a source is active?
Or is the simple fact that there is nothing coming in on a source sufficient that it will not affect the output if the two are continually mixed?

I hope someone can guide me in the right direction.

You must be logged in to vote

As the documentation clearly states, only a regular ESP32 support Classic Bluetooth. All other variants only support BLE!

Since Espressif plans to remove the A2DP functionality from Arduino, using an external module is a good choise.

Also have a look at the Wiki Documentation: Analysing Audio: Determining the Volume. You can build a switch using the VolumeMeter and switch the mixer on when you get some signal and switch it off after a defined period w/o volume.

I would recommend to do the mixing only when it is needed.

Replies: 1 comment 1 reply

Comment options

As the documentation clearly states, only a regular ESP32 support Classic Bluetooth. All other variants only support BLE!

Since Espressif plans to remove the A2DP functionality from Arduino, using an external module is a good choise.

Also have a look at the Wiki Documentation: Analysing Audio: Determining the Volume. You can build a switch using the VolumeMeter and switch the mixer on when you get some signal and switch it off after a defined period w/o volume.

I would recommend to do the mixing only when it is needed.

You must be logged in to vote
1 reply
Comment options

I have added the new AudioInputMonitor class.

Answer selected by pschatzmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /