Skip to content

feature/audio-mixer#21

Merged
chmorgan merged 12 commits intochmorgan:mainfrom
Mattel:feature/audio-mixer
Jan 23, 2026
Merged

feature/audio-mixer#21
chmorgan merged 12 commits intochmorgan:mainfrom
Mattel:feature/audio-mixer

Conversation

@robert-alfaro
Copy link
Contributor

This PR introduces a major feature to the esp-audio-player component: Audio Mixer support.

The mixer allows simultaneous playback of multiple audio sources (streams) by mixing their PCM data into a single I2S output. This addition significantly enhances the flexibility of the audio player, enabling use cases like background music mixed with sound effects or multiple concurrent voice prompts.

@chmorgan
Copy link
Owner

@robert-alfaro this is an impressive PR, thank you so much. Could I ask what might have driven the development of this feature? I went through each commit, didn't see anything too concerning, are there any areas where you'd like me to focus on in terms of review?

@robert-alfaro
Copy link
Contributor Author

@robert-alfaro this is an impressive PR, thank you so much. Could I ask what might have driven the development of this feature? I went through each commit, didn't see anything too concerning, are there any areas where you'd like me to focus on in terms of review?

thanks -- honestly the same two reasons this lib exists -- really we just needed a simple audio mixer without the overhead of esp-adf and keeping things opensource. Having minimal dependencies keeps options open as we adapt over time. This now allows for having background music + sfx on top. It is flexible enough to receive audio frames from a FILE handle or from a pcm stream like USB Audio, for example. Additionally, I've added a stream level queue for immediately sequencing multiple audio assets.

In terms of review, I don't think anything in particular stands out... I did try to preserve the original singleton behavior. Whether that approach forever remains is not up to me.

The only caveat with the mixer right now is all the stream instances need to submit the same format, i.e. rate/bits/ch, as that'd require resampling.

@chmorgan
Copy link
Owner

@robert-alfaro well this looks quite good, merging it in now, thank you for the contribution!

@chmorgan chmorgan merged commit 3cfeb34 into chmorgan:main Jan 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants