Understanding & playing WAV files on ESP32 using I2S. An In-Depth Tutorial with very simple example.

Поділитися
Вставка
  • Опубліковано 29 сер 2024

КОМЕНТАРІ • 23

  • @FaizQ12
    @FaizQ12 Рік тому

    Is it possible to play multiple sounds using this code? I am trying to play sound1 when one button is pressed and sound2 when another button is pressed.
    If not, is it possible with the SD card reader option and how so?

  • @user-li1dy7if1r
    @user-li1dy7if1r 2 роки тому

    Cool! How to add multiple Wavs and enable / disable them by condition?

  • @avieleliyahu6199
    @avieleliyahu6199 4 роки тому +1

    Thank you so much! This video is excellent!
    I have a question about the wave.h: Does it has to be in hex? If I'll write it as a short int, will it still work?

    • @XTronical
      @XTronical  4 роки тому +1

      Doesn't have to be hex, just make sure your storing 16 bit signed integers.

    • @avieleliyahu6199
      @avieleliyahu6199 4 роки тому

      @@XTronical
      Thanks for the answer!
      Btw, I really like your videos, they are coherent and crystal clear (and above all, you're helping others in the comments!).
      It's not much, but I donated 20$, keep up the good work!

    • @XTronical
      @XTronical  4 роки тому +1

      Thanks for the kind words. I appreciate it. And thank you very much for that donation, that is loads, honestly, to give to a stranger! Thank you again. All money goes into the channel.

    • @avieleliyahu6199
      @avieleliyahu6199 3 роки тому

      @@XTronical
      Hey, I have another question:
      I noticed that for some of the WAV parameters, the values are reversed.
      For example, looking at the Sample Rate portion, you wrote 0x80, 0x3E, 0x00, 0x00
      But when I converted 16000 to hex, I got 3E80, so why didn't you wrote 0x3E, 0x80, 0x00, 0x00?
      I'm mainly asking because for the size portion, you wrote 0x10, 0x00, 0x00, 0x00, which corresponds to 16,000.

  • @EduardoBaladao
    @EduardoBaladao Місяць тому

    Please, can you actualize the XT_DAC_AUDIO library? It has several errors now latter the atualization 2.x to 3.0 of espressif changes commands.

    • @XTronical
      @XTronical  Місяць тому +1

      Thanks for the information. I'll take a look.

    • @EduardoBaladao
      @EduardoBaladao Місяць тому

      @@XTronical Thanks for your atention! Your library is the easiest to use and I cant now use a simple hex song for my project without this update in some commands.

  • @pwbarrett7
    @pwbarrett7 Рік тому

    I see hardcoded references to the GPIO pins 25 and 26 in the library code. If I want to use this on an ESP32-S2, where the DAC GPIO pins are 17 and 18, should it work just to change those references? (I tried just doing that and don't hear anything.)

    • @XTronical
      @XTronical  Рік тому

      Yes, you'd have thought so in theory. I can't remember the exact differences off hand to know why it wouldn't work. Have been successful with a normal esp 32?

  • @thomasmoller2086
    @thomasmoller2086 6 місяців тому

    I wonder if you or anyone else got this working on a specific core of an ESP32. I just tried that and it stays silent.

  • @royhopkins974
    @royhopkins974 2 роки тому

    Great viseo
    I have successfully included 3 small hex header files.
    If I change in setup const unsigned char *WavFile = headerfilename;
    then I can play each file after recompiling and uploading.
    I want to know how I can change to different sounds (Using switch case in the void loop() section and play the sound once.
    The switch statement will depend on a button press so that I can play each sound depending on which button is pressed.
    Thanks in advance and keep up the good work

  • @tusharpc
    @tusharpc 3 роки тому

    thankyou for these, I 've sunk an entire afternoon going through your DAC wav and i2s videos. currently for a model train sound project I'm using a esp8266 and the DF robot mp3 player to produce sounds but looking at your videos I'm encouraged to switch to esp 32. sound mixing, vol and speed controls are a big plus. one fundamental question, what is the benefit or need to use i2s instead of the built in DAC? is it just to be able to use any pin on esp32 and get better sampling rate above 8mhz? or are there other benefits ? coz it seems either ways externally you still need an amp board or a i2s decoder with built in amp?

    • @XTronical
      @XTronical  3 роки тому +2

      As you mention the sound quality can be much higher in addition it's easier to do stereo, requiring only the one same single pin. We'd need two dac pins for stereo using DACAudio. At the moment existing i2s libraries are not as flexible as DACAudio which is why I'm implementing that library for I2s.

    • @tusharpc
      @tusharpc 3 роки тому +1

      @@XTronical absolutely gonna watch and wait for the i2s audio library and it's corresponding video.
      Have you tried basic wifi functions of simple webserver libraries and so they work well with your dac and later i2s libraries? My end goal is to have a remote motor ctrl receiver and be able to drive audio sounds ( engine sounds) in parallel to the motor commands like speed or direction.

  • @marshalac
    @marshalac 2 місяці тому

    do u have a circuit schematic?

    • @XTronical
      @XTronical  2 місяці тому

      On my website xtronical.com

  • @lancebantoto
    @lancebantoto 2 роки тому

    Hello! Is there a way to convert a wav file into an .h file on a Mac?

    • @XTronical
      @XTronical  2 роки тому

      I would have thought similar software to that used on the PC exists but I don't use mac unfortunately.