You’ll want the i2s_audio still, and you’ll need speaker as well. Set up the i2s_audio and mixer (not sure if you need this or not - but it does nothing if not needed I believe) platforms and possibly resampler too (only need one if no announcement pipeline). Then, you add the media_player with the speaker platform (don’t need the announcement pipeline or files sections). That should be it. Make sure the media player has a name so HA has it exposed and you can then stream audio to it.
Yes, the new config seems much heavier, but there are significantly fewer problems. You’re not missing anything - it used to be real simple and easy for your simple use case, but other situations either didn’t work or were very buggy. The new format fixes all those at the cost of making it seem more complex for a simple setup… but it’s way more robust and configurable now.
All I can add to the above is there are changes still happening to the esphome media player, and these are likely to be added to sendspin side over the next few esphome versions. How this will affect the media player if not using sendspin I don’t know.
What I am saying is if your player is stilll working wait a bit before updating the code as you may find yourself in the same space next month.
Anyhow there are some working examples here if it helps.
[11:45:54.037][E][speaker_media_player.pipeline:117]: Media reader encountered an error: ESP_ERR_NOT_SUPPORTED
[11:45:54.040][E][speaker_media_player:362]: The announcement pipeline's file reader encountered an error.
This code got mine working again. I was getting a bunch of different errors before, too. I’m just not sure if you can play MP3s with it. In any case, the voice prompts are working again.
@PedroArkanson without at least a resampler, I believe you will run into problems playing anything but a 16bit WAV file. The example configs show how to set both of those up and have the media_player use them instead.
That was the only code that worked for me. I tried it for several days, and it works fine for my TTS announcements. I can’t switch to esp-idf because of the BME680 BSEC. Sure you can increase the sample rate for better sound quality.
I was curious what that was so went reading - I don’t see it saying where you cannot use esp-idf with the BME680. It seems like BSEC and BSEC2 both should work with either esp-idf or arduino (which I believe was refactored recently to now be on top of esp-idf). Just FYI in case you weren’t aware.
I don’t remember for sure, but it definitely didn’t work because of an error message saying that esp-idf and BSEC aren’t compatible. But it doesn’t really matter, it works for me, and I’m happy with it.
indeed , but changing this did not work , so i was forced to install an old ephome version in docker to flash i2s speaker without hassle and use my 'old' yaml that worked for years
I, too, am trying to update my old working i2c device. After several attempts, this is what worked for me. My trials did not include the on_play, on_pause, on_idle bit which it had in my old code. When I added, I was able to hear playbacks.