Adding volume control to our own ESP32 SD Card I2S WAV Player. Principles of digital volume control.

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

КОМЕНТАРІ • 33

  • @Mr.Kent65
    @Mr.Kent65 6 днів тому

    Amazing video but just a side note the the more resistance the less current will be wasted. Not the other way around.

  • @alfredopreciadomolina1576
    @alfredopreciadomolina1576 4 роки тому +2

    Thanks for the lessons, i've learned a lot of interesting facts.

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

      Thank you for the feedback

  • @mikea683
    @mikea683 4 роки тому +2

    You're a wizard matey!

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

      Thanks for kind comments, I tell the wife I'm a wizard, she insists I'm actually a kn0b! Hey ho.

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

      @@XTronical hahaha... Bedknobs and Broomsticks had wizards in it didn't it? Let's assume that's where the confusion comes from :)

  • @lautungho1
    @lautungho1 Рік тому +1

    awesome!!

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

    Hi, Following your I2S work with interest and fascination. I've come across a problem, I'm trying to add a volume control to your Internet Radio project with no success. Everything I've tried points to the value of the volume control not being read! I've created a standalone sketch using your code to read and display the READ value and the ADJUSTED value which is working fine but just not in the radio project.... Have you any thoughts??

    • @CarlosSoto-yq3tu
      @CarlosSoto-yq3tu 2 роки тому

      Solo hablo español , al parecer el control de volumen se logra usando I2C el cual usa también el wifi y no pueden trabajar juntos , a mi me paso tratando de hacer una radioweb

  • @ArunKumar-us6zn
    @ArunKumar-us6zn 2 роки тому +3

    very interesting project I love to duplicate this and can you also add OLED display, and RADIO please?

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

      Yes, I worked on a display with an graphic equaliser but had some problems and shelved it for a while. Just couldn't get the correct frequency response.

  • @alfredopreciadomolina1576
    @alfredopreciadomolina1576 4 роки тому +2

    I have read that the adc of the esp32 has stability and noise problems, I imagine that at high volumes it can be heard

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

      It does, it's a bit rubbish at around less than 0.3 volts and above about 3.1 ish volts but OK in the middle, so it generally does OK for this use. Mostly the sound is either silent or full volume before these points. But you may want to use push buttons perhaps.

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

      @@XTronical So I'll use a gyroscope, just for fun 🤓🤣

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

      Brilliant, lol

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

    or easier with vs1053 modul .. also, more esp power for many other work. :)

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

      Can this play/mix multiple mp3 /wavs at once? This was an essential feature when I wrote my original DACAudio software library and is where I'm going with this.

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

    What's the name of the song you were playing?

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

      Sorry, can't remember, it will have been from the you tube copyright free library.

  • @jonshouse1
    @jonshouse1 4 роки тому +2

    Or you could just use a dual POT and put it on the audio outputs. I agree with your coding style, using "write only code" is not big or clever :-)

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

      What do you mean, put on audio outputs? If on output of dac then it won't work there unfortunately, you'd either get no sound when high resistance (most of time) or when pot was at low resistance it would burn out. Or have I misunderstood?

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

      @@XTronical I should have read the datasheet first, disregard my comment. What a horrible IC, no 1v analogue path at all, has a "gain" pin but is seems of little use. Rather poxy if you want to connect and external AMP, my guess is it is aimed at toys.

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

      @@jonshouse1 Is it possible to put a potentiometer before the speaker?

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

      todos equipamentos que conserto o controle de volume é feito após o dac, no máximo com níveis controlado -12db e +12db, e devem ser manipulados de uma forma que não ultrapassem os bits do i2c, claramente é feito por um processador dsp, após isto o audio é convertido com dac novamente, poren, com volume constante, sendo assim o verdadeiro volume em tempo real é controlado por circuitos externos e tone, em analógico, só assim saindo para um amplificador, e falantes.
      minha expressão é para ajudar, XTronic esta certo, isso não deve ser feito, ultrapassa o tamanho em bits, quando o i2s de 16bits tenta elevar maior, oque acontece é falha ele tenta aumentar a taxa, mas o sistema não foi feito para ultrapassar 32bis 16bits r, 16bits l.
      acima disso não foi gravado audio no arquivo wav com mais de 32bits 44 000 , oque quer dizer que vai reproduzir ruídos aleatorios, e consumir tempo do bufer.
      exemplo: se o arquivo tem 32bits LR, e você tentar manipular para aumentar o som, vamos dizer + 10% ele ficando em 42 bits, oque se ouve é 32bits de wav limpo, e 10 bits de 0 e 1 , reproduzindo um ruído é uma falha no tempo, deixando o som orrivel.
      trabalho com equipamentos profissionais, se nem eles trabalharam no controle de som digital, é porque não tem solução, ou vulgar.
      ou simplesmente uma constante , o som digital que foi gravado em 32bits, precisa ter a mesma amplitude para igualar.
      desculpe a linguagem.

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

    how to add stop? or just play one loop

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

      Both those features are implemented. By default it only plays a sound once. You have to set a property to the number of repeats if to u want a certain amount.

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

      @@XTronical the sound produced by the i2s speaker is different from the sound played on the computer?

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

      If you keep the same samples per sec. They should be very similar but obviously different speakers and amp may make them sound slightly different

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

      @@XTronical solved, problem the samplerate

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

      If you look at my latest video, my new I2SAudio library would have sorted this for you

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

    Why don't you use ESP32 own DAC? As far as I know, the same library allows it.

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

      I've written my own library some time ago that does that, search for xtronical DACAudio. But the quality of the 8 bit sound is not as good as i2s, hence this work and my own new library coming up soon.

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

      Ahh, thinking on, you may mean outputting as pdm? In this case, actually in the case of the 8 bit dac too, you only get mono sound out as well, not stereo. Although I only ever have one speaker connected at once in my demos it is stereo sound.