Coder Social home page Coder Social logo

mxbchr / esphome-singlecore-i2s-audio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from winteris/esphome-singlecore-i2s-audio

0.0 0.0 1.0 664 KB

ESPHome I²S Audio Media Player Component for ESP32 single-core chips (ESP32C3)

C++ 64.70% Python 35.30%

esphome-singlecore-i2s-audio's Introduction

ESPHome I²S Audio Media Player Component for ESP32 single-core chips

Similar to the Official Component I²S Audio Media Player, this is a External Component made for ESPHome, it can be used to create an ESPHome Audio Media Player in Home Assistant. The difference is that the audio library it uses is from earlephilhower/ESP8266Audio, which can run on ESP series single-core chip(like ESP8266, ESP32S2, ESP32C3), so it works on my ESP32C3. This component is written separately for the airm2m_core_esp32c3 development board, and you can modify this component yourself to make it work with your own board.

It is able to :

  • Register an Audio Media Player into HomeAssistant
  • MP3 from URL only
  • HTTP URL only

Another advantage of ESP8266Audio over schreibfaul1/ESP32-audioI2S is that, the ESP8266Audio can play wav files from local flash, and I tested it successfully on esp32c3, you can see more samples in https://github.com/earlephilhower/ESP8266Audio.

How to use

See usage in ESPHome Page External Component. You will see it is easy to use the local path:

  1. Clone this repository and copy the /my_components folder to ESPHome /config folder, where you can see your yaml files. You can modify the local file every time you want.
  2. Add this into your yaml:
external_components:
- source: my_components

# Default value if not defined : GPIO1 GPIO18 GPIO0
media_player:
- platform: singlecore_i2s_audio
    name: ESPHome I2S Media Player
    dac_type: external
    i2s_dout_pin: GPIO1
    i2s_lrclk_pin: GPIO18
    i2s_bclk_pin: GPIO0
  1. Connect your DAC module to the development board:
DAC  <----> dev board
vin  <---->   3.3v
gnd  <---->   gnd
din  <----> i2s_dout_pin(def GPIO1)
lrck <----> i2s_lrclk_pin(def GPIO18)
bck  <----> i2s_bclk_pin(def GPIO0)
sck  <----> gnd(if i2s_mclk_pin is not used)

Image 4. Then you can compile and install your firmware.

Thanks

This component is modified from:

Thanks to all them.

esphome-singlecore-i2s-audio's People

Contributors

winteris avatar mxbchr avatar

Forkers

jonahnm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.