Thanks for the sample. Has anyone been able to play more than one audio file with this? What other code would have to be added to have it play multiple files?
Thanks a lot for your great tutorial. One point to add, i.e. as far as I tested, connecting the SD card vcc to vin pin of ESP32 board makes it work normally. I used the same SD card reader as the video demostrated.
Hi I getting Error compiling this code, Audio audio was not name a type, I used the library that you put in the video. I also use a ESP32. Do you know what's happen? And Thanks for your tutorial, it is great.
@@XTronical The error continues. It says: the Audio library is intended to run on sam architecture(s) and may be incompatible with your current card which runs on esp32 architecture(s). I changed the library for an older one. :((
hey can u please help. I want to play 2 different music at same time on both internal DAC in esp32 (1st one is played on pin25 on1st DAC & 2nd music is played on 2nd DAC at same time in esp32).
@@XTronical there are 2 mp3 in the SD card & also set the different audio on different channel to play but only one audio play on both channel but i want to play different mp3 on different channel at same time. have u the code related with mine question.
Hi! Great video! I am trying to figure out a way of playing multiple sounds, as in a talking clock. I can play single sounds, but getting the system to have a function to which an MP3 file name can be passed, played, and then returned to wait for the next one is a little tough. Do you have any pointers?
Can't remember at moment and only on my phone but does the code not wait till the sound completes. If not then there should be some properties that state length of time the sample takes. Least I would have thought saw. You then as you worked out need to just pass the filename to the function.
@@XTronical I tried to add two sounds but it actually doesn't play either sound. In the current system, the file is attached to the audio object in the Setup() and the Loop() has only audio.loop(). The audio library not really well documented.
Yes, other i2s decoders are available that have a jack built in. Or you can just wire up a socket to the output and it'll work fine. The impedence of earphones is much greater than the speakers being used. Just ensure you connect correctly.
Do you think the ESP8266 (Single 80Mhz Core) could do this, or do you need the power of the ESP32 (160Mhz Dual Core)? BTW, any thoughts on using Visual Studio Code with the Espressif IDF extension instead of the Arduino environment?
Yes, it should be able to, I think the libraries github page (link in description) may confirm. I've got plans to move over to VS, I use it as a simple editor but not properly.
Are their libraries /Boards that will support 128g etc.. Sd Cards and long filenames/different file systems or are such things above the ability of the esp32??
Not to my knowledge but I've never had the need for one that big. I imagine there is a technical problem with above 32gb and the 32bit addressing. I would think not insurmountable but I've never looked into it.
Hi, thanks for the video, it was useful content. Do you have a video where you explain how to get the code on the ESP32 chip? You seem to be skimming through this very quickly
Getting the esp32 to work with the Arduino ide is beyond the scope of that video. I have done a seperate video on this but it is quite old and probably out dated. I would type in "esp32 on arduino" ide" on RUclips for an up to date guide on how to set up and upload code to esp32. Then this guide should be easier.
Did you do the mod to the SD card? It's at 1:33 in the video. On some SD card boards you need to disconnect the regulator and solder a quick by-pass to get them to work with ESP32.
Trying to remember, it can be done but it's a faff, when I was researching the previous episode I read solutions, just can't remember where I read the info off top of my head. I think the extra complexity is why I selected DACS that did not need it.
Depends what level of control you'd want I guess. You can read the input from sensor and control basic play back but I don't think the library offers a lot of control over the output.
It's from the datasheet, you can attach the gain to gnd, vcc, or to some resistors for various gain settings. I think this gives 9 dB if I remember correctly.
@@XTronical hey again, so is the library supposed to only work with 8 or 16 bit pcm? And if so why are all the test sounds in the library folder 32bit?
Yes and no. The tech is basically the same. The factors that matter would be the bit rate of your sample and the quality of the speaker and it's housing. Probably the speaker and enclosure being quite important as bit rate is easy to change. For there speaker size most reasonable phones do a good job. So some effort has gone into that area.
@@XTronical yes, I have been programming for a few years. Made my own 3d printer with a laser cut frame. And programmed Marlin. And made a few Arduino projects. Like to watch and learn things like what you do. Been programming a ESP2866 WiFi module to control my 3d printer. I upgraded the memory chip on it to 4mb from 1.
Hey, wow, the stuff you've done is fantastic. I really like that music too. I have very little talent for music unfortunately, wish I had some! Do you want me to use your stuff in a future (probably next) video and give you a shout out?
Thanks for taking the time to pop over to my page much appreciated. I would be very happy for you to use some of my tracks. Not sure which is best suited. But I do record most days. I have many tracks you could use. My email is interplain1@gmail.com I will remove this when you have read it. And replied to this. Not sure if you can personal message within RUclips. Not found it if you can.
@@XTronical I have not tested. I'm just basing my statement on you leaving the SD pin of both MAX98357A boards unconnected. This will put the boards into mono mode and output (L+R)/2 from both. Yes, you will hear sound from both speakers, but it will be the same sound. You have to configure the voltage on the SD pins to specifically select Left or Right channel.
You've misunderstood the use of the SD pin, check the data sheet but in brief. The SD is not the pin that selects stereo channel. It either shuts the device down if low or if high (and unconnected floats high) it specifies that the LRCLK pin should be used to determine which data is left or right channel. The timing diagrams are in the datasheet for LRCLK etc. As I said I tested with special stereo testing tracks for Mp3 as well. Basically if high it is saying "OK work normally in stereo I2S" which then uses the LRCLK pin for left and right channels. So you can see all is correct. The clue is in the pin names, SD for Shut Down, LRCLK for Left Right Clock. Look up my video explaining I2S, that may help
@@XTronical I agree hat LRCLK determines the channel of the current data stream, but there also needs to be something that tells each individual chip which channel to output. One chip has to output data while LRCLK is high and the other while LRCLK is low. This is the function of the SD_MODE pin to give it its full and proper name. As you say, grounding this pin shuts things down. Different voltages on this pin (via pullup resistors) define the mode which can be Left or Right or Mono. No connection gives Left channel only. As you have tested with stereo tracks and everything works, I can only think that one of the chips must be a MAX98357B which defaults to right channel if left unconnected. Otherwise I fail to see how two identical chips, wired the same way and fed the same data can output different sounds.
Right, some apologies but also I'm not sure you've listened to the video closely. Firstly yes, you have to do something to the boards to get stereo but it's nothing to do with the SD pin. I forgot about that bit in my replies, but it's been a while since I did this video but sorry for forgetting that. But at just 50 seconds in it tells you to watch my earlier video on setting these boards up for stereo as I won't be covering that again in this one, I even emphasise how important it is to do this. You must have missed this information or forgot I'd mentioned it. So that should clear that up. Once again, sorry for any confusion caused.
And some prefer this style, ever heard the phrase "you can't please all of the people all of the time". From your recent comments you don't like my style, you don't like my hobby approach, why the heck do you keep watching? I avoid things that I don't like and don't have to do. Bizarre! Vote with your eyes and don't watch.
Thanks for the sample. Has anyone been able to play more than one audio file with this? What other code would have to be added to have it play multiple files?
Thanks a lot for your great tutorial. One point to add, i.e. as far as I tested, connecting the SD card vcc to vin pin of ESP32 board makes it work normally. I used the same SD card reader as the video demostrated.
Im looking at using a rotary encoder to play an audio file. Is there a way i can stop the audiofile when i stop turning the encoder
Nice tutorial... and thanks. Love the William Turner quote.
Hi I getting Error compiling this code, Audio audio was not name a type, I used the library that you put in the video. I also use a ESP32. Do you know what's happen? And Thanks for your tutorial, it is great.
I'd check library version just in case something has changed. It may be you are on latest version and I'm using older one due to age of video.
@@XTronical The error continues. It says: the Audio library is intended to run on sam architecture(s) and may be incompatible with your current card which runs on esp32 architecture(s). I changed the library for an older one. :((
hey can u please help. I want to play 2 different music at same time on both internal DAC in esp32 (1st one is played on pin25 on1st DAC & 2nd music is played on 2nd DAC at same time in esp32).
My DACAudio can do this, mixing both sounds onto to one channel. It will only work with sounds stored in esp32 memory though.
@@XTronical there are 2 mp3 in the SD card & also set the different audio on different channel to play but only one audio play on both channel but i want to play different mp3 on different channel at same time. have u the code related with mine question.
I don't, sorry.
Hi friends, my problem is that the SD card is not initialized. Can combining two pins in SD module like the one in the video work? need help :)
Sir,I use esp32sim800l(ttgo tcall) and I get error talking to sd card!. What could it be the problem?I tried 3.3 and 5v vcc.I use micro sd module.
Hi! Great video! I am trying to figure out a way of playing multiple sounds, as in a talking clock. I can play single sounds, but getting the system to have a function to which an MP3 file name can be passed, played, and then returned to wait for the next one is a little tough. Do you have any
pointers?
Can't remember at moment and only on my phone but does the code not wait till the sound completes. If not then there should be some properties that state length of time the sample takes. Least I would have thought saw. You then as you worked out need to just pass the filename to the function.
@@XTronical I tried to add two sounds but it actually doesn't play either sound. In the current system, the file is attached to the audio object in the Setup() and the Loop() has only audio.loop(). The audio library not really well documented.
I try looking through the header file of the library. I can't be much more help at the moment as I don't have access to a computer.
@@XTronical thank you for this.
Thank you for this very simple tutorial.
is there any way to conect thos pins of i2s to and auxiliar jack cable?
Yes, other i2s decoders are available that have a jack built in. Or you can just wire up a socket to the output and it'll work fine. The impedence of earphones is much greater than the speakers being used. Just ensure you connect correctly.
Hi there, nice project. What would be the sampling rate of your output DAC?
Upto 50000 samples per second max
Do you think the ESP8266 (Single 80Mhz Core) could do this, or do you need the power of the ESP32 (160Mhz Dual Core)? BTW, any thoughts on using Visual Studio Code with the Espressif IDF extension instead of the Arduino environment?
Yes, it should be able to, I think the libraries github page (link in description) may confirm. I've got plans to move over to VS, I use it as a simple editor but not properly.
Are their libraries /Boards that will support 128g etc.. Sd Cards and long filenames/different file systems or are such things above the ability of the esp32??
Not to my knowledge but I've never had the need for one that big. I imagine there is a technical problem with above 32gb and the 32bit addressing. I would think not insurmountable but I've never looked into it.
at 1:16 in text box you wrote GAIN ->GND but on your board it is connect to VCC?
You can connect to either. Different connection gives a different gain. I think I list these on the project page linked in the description.
Hi, thanks for the video, it was useful content. Do you have a video where you explain how to get the code on the ESP32 chip?
You seem to be skimming through this very quickly
Getting the esp32 to work with the Arduino ide is beyond the scope of that video. I have done a seperate video on this but it is quite old and probably out dated. I would type in "esp32 on arduino" ide" on RUclips for an up to date guide on how to set up and upload code to esp32. Then this guide should be easier.
I did everything like in video but sd card won't initialize.
Did you do the mod to the SD card? It's at 1:33 in the video. On some SD card boards you need to disconnect the regulator and solder a quick by-pass to get them to work with ESP32.
@@XTronical I found the isue, I added filtering capacitor to power line, and everything works fine
Brilliant, thanks for adding this info. The current draw can cause issues.
Very useful video, ty buddy!
what if the Amp or DAC requires MCK, what should I do?
Trying to remember, it can be done but it's a faff, when I was researching the previous episode I read solutions, just can't remember where I read the info off top of my head. I think the extra complexity is why I selected DACS that did not need it.
Hello is it possible to regulate the volume digital with this library? Great video btw!
Yes, you can.
Can you make it controllable with piezoelectric input? Like octapad?
Depends what level of control you'd want I guess. You can read the input from sensor and control basic play back but I don't think the library offers a lot of control over the output.
Why is the gain in the video connected alongside the vcc?
It's from the datasheet, you can attach the gain to gnd, vcc, or to some resistors for various gain settings. I think this gives 9 dB if I remember correctly.
@@XTronical so the best choice would be to connect it to the vcc?
For my speaker it gave good volume without distortion. Larger or smaller speakers may be OK with different setting.
I see the speakers themselves are listed, but what about those printed cases?
Sorry, any 4 to 8 ohm speakers will do. Those ones on screen are out of an old laptop. The ones listed are just ones that are suitable.
if my mp3 file on the sd card is named "music" does the string in the code need to be "music.mp3" or "/music.mp3" ??
As it originally is "/amaze. mp3" it would be "/music. mp3"
@@XTronical thanks
@@XTronical hey again, so is the library supposed to only work with 8 or 16 bit pcm? And if so why are all the test sounds in the library folder 32bit?
It should work with a variety of bit rates etc. As long as they are mp3. It will then convert to i2s/pcm for transmission to the decoder chip.
does it sound better than regular phone mp3 ?
Yes and no. The tech is basically the same. The factors that matter would be the bit rate of your sample and the quality of the speaker and it's housing. Probably the speaker and enclosure being quite important as bit rate is easy to change. For there speaker size most reasonable phones do a good job. So some effort has gone into that area.
@@XTronical oke
Would you please keep in silence a bit more to appreciate the audio quality? Thanks!
Sorry,
@@XTronical Thanks for understand.
Bravo !!! But alas, my talents lie elsewhere....1:10
Thank you.
lol
You were corpsing for ages after that balls-up.
How many Rum and Coke did you have lol
Ha ha, not enough! You must have been a sub for quite a while, not mentioned rum and coke in ages!
@@XTronical yes, I have been programming for a few years. Made my own 3d printer with a laser cut frame. And programmed Marlin. And made a few Arduino projects. Like to watch and learn things like what you do. Been programming a ESP2866 WiFi module to control my 3d printer. I upgraded the memory chip on it to 4mb from 1.
Hey, wow, the stuff you've done is fantastic. I really like that music too. I have very little talent for music unfortunately, wish I had some! Do you want me to use your stuff in a future (probably next) video and give you a shout out?
Thanks for taking the time to pop over to my page much appreciated. I would be very happy for you to use some of my tracks. Not sure which is best suited. But I do record most days. I have many tracks you could use. My email is interplain1@gmail.com I will remove this when you have read it. And replied to this. Not sure if you can personal message within RUclips. Not found it if you can.
I've read it (sorry for taking so long), will contact you. You tube used to do a messaging sort of thing, but not anymore
Second MAX98357A and speaker are a waste of time and money in this configuration. No difference between left and right channels.
I've tested with a known stereo test track, it shows it works. How are you testing?
@@XTronical I have not tested. I'm just basing my statement on you leaving the SD pin of both MAX98357A boards unconnected. This will put the boards into mono mode and output (L+R)/2 from both. Yes, you will hear sound from both speakers, but it will be the same sound. You have to configure the voltage on the SD pins to specifically select Left or Right channel.
You've misunderstood the use of the SD pin, check the data sheet but in brief. The SD is not the pin that selects stereo channel. It either shuts the device down if low or if high (and unconnected floats high) it specifies that the LRCLK pin should be used to determine which data is left or right channel. The timing diagrams are in the datasheet for LRCLK etc. As I said I tested with special stereo testing tracks for Mp3 as well. Basically if high it is saying "OK work normally in stereo I2S" which then uses the LRCLK pin for left and right channels. So you can see all is correct. The clue is in the pin names, SD for Shut Down, LRCLK for Left Right Clock. Look up my video explaining I2S, that may help
@@XTronical I agree hat LRCLK determines the channel of the current data stream, but there also needs to be something that tells each individual chip which channel to output. One chip has to output data while LRCLK is high and the other while LRCLK is low. This is the function of the SD_MODE pin to give it its full and proper name. As you say, grounding this pin shuts things down. Different voltages on this pin (via pullup resistors) define the mode which can be Left or Right or Mono. No connection gives Left channel only.
As you have tested with stereo tracks and everything works, I can only think that one of the chips must be a MAX98357B which defaults to right channel if left unconnected. Otherwise I fail to see how two identical chips, wired the same way and fed the same data can output different sounds.
Right, some apologies but also I'm not sure you've listened to the video closely. Firstly yes, you have to do something to the boards to get stereo but it's nothing to do with the SD pin. I forgot about that bit in my replies, but it's been a while since I did this video but sorry for forgetting that.
But at just 50 seconds in it tells you to watch my earlier video on setting these boards up for stereo as I won't be covering that again in this one, I even emphasise how important it is to do this. You must have missed this information or forgot I'd mentioned it. So that should clear that up.
Once again, sorry for any confusion caused.
Perhaps a few more "Take Two!" calls would be better rather just mucking about? We all make mistakes, but not everyone want to watch them.
And some prefer this style, ever heard the phrase "you can't please all of the people all of the time". From your recent comments you don't like my style, you don't like my hobby approach, why the heck do you keep watching? I avoid things that I don't like and don't have to do. Bizarre! Vote with your eyes and don't watch.
Stop trying to be funny, it is distracting
Just don't watch then, loads of other channels.