Voice Assistant esphome with Esp32-s3 - Max98357 - Inmp441

I like to share my code for a voice assistant, it’s been hard to actually make it work, I modify a Bluetooth speaker and add it inside for more appeal case.

I had two versions, one for
esp32 wroom without media player, timer, and continuous conversation, lights, without micro wake word

ESP32 dev
Max98357
Inmp441
led strip of 4 segments

and an esp32-S3
with media player, vol up and down, timer, continuos conversation, lights, mute without micro wake word, sound on vol up and down, mute and timers, also sound on boot

ESP32-S3 N16R8
Max98357
Inmp441
2 buttons to control volume of media player
led strip of 4 segments

code and sound files

5 Likes

Looks great. What’s the speaker you’re using?

is a chinesse one only cost 5 dollars in mercadolibre is a pgae like ebay i been trying to find it on aliexpress with not luck

this ones can work
speakers 1

speaker 2

speakers 3

I upload to GitHub a few codes for different boards, im still working on them,

You are using many outdated solutions.
If your board has PSRAM, it makes sense to create two audio pipelines, so music will always play in parallel and be muted during announcements.
Additionally, there’s no point in disabling the wake word; it would greatly simplify the operational logic (see the code for VPE or ReSpeaker Lite).

I agree but also depend on the hardware you are using ReSpeaker use different hardware for audio output, and 2 microphones just like voice PE
in this configuration you are only using a Max98357 and a Inmp441

It’s not critical, you can take a look at my solution. I’ve been testing it for a week and haven’t noticed any issues. However, I removed everything related to the addressable LED since I’m not a fan of it.

will take a look thanks

great work , is perfect just need to add light lol i like the light for status notification appreciate sharing your code

I will test your setup too…
is there a place where i can download the audio files for the sounds or do i have to search for them?

in my github

already seen and downloaded but they are not flac… I don’t know if this can affect

The files are on github, so you can use links to avoid downloading them manually. Or replace them with your own.
I saw a post about led, you can return the original led control script and running it in triggers without problems. Don’t forget to remove my indicator and related actions.

 - platform: gpio
    pin: GPIO10
    id: wake_led
    name: “Rec”
1 Like

this is the code of mchk with led

btw great work i love that you can use music assistant

1 Like

Testing it…

really great! The fact that it stayed listening shortly after the action is really convenient and functional. thanks to everyone!

Only problem… once the timer rings I can’t turn it off with my voice.
I don’t know if this is due to the code change for the LEDs and buttons or if it doesn’t work by default.

In my configuration it definitely works (using ok_nabu). Theoretically, adding new actions should not affect the operation. If it doesn’t work, try removing the LED triggering for the timer_ringing switch, this will free up some resources.

If you are talking about the word “stop” then it should be added additionally for timer_ringing triggers. Use the commands micro_wake_word.enable_model: stop and micro_wake_word.disable_model: stop

1 Like

my mistake…it works

I can also recommend expanding the word list for the HassNevermind intent:
This will explicitly stop the pipeline at the listening stage, instead of waiting for time to expire. This often sounds pretty natural, especially when interacting with llm.
Here is my example, do similar for your language

2 Likes

it work i also can stop it with voice


Can you describe more about these 3 versions. Thanks a lot!