Make Arduino Play ANY Audio File (Without SD Card) QUICK TUTORIAL
HTML-код
- Опубликовано: 14 окт 2024
- YES CLICK THIS LINK:
drive.google.c...
(download at own risk, this is not my creation however I have not encountered any problems with it)
Using this tutorial you should be able to make your Arduino play audio despite what the original audio file was (.mp3 .wav .ogg .m4a etc.). I made this video because I used this technique for a upcoming project (a realistic pokeball) and found some tutorials online but many were very long so I thought I can explain this quicker.
Inspired by:
www.instructab...
• Play MP3 audio on your...
• How to Play audio with...
Music:
King Porter Stomp by Joel Cummins
If you are looking for another way to play audio on Arduino, here are another 3 options: ruclips.net/video/UN9XPWHamHw/видео.html
Hello brother, this encoder application is not available in the drive ..so could please send a new drive link consisting of this application.. please brother it is very important
Your editing and voiceover is top quality. I don't even like arduino but this is an amazing video and I just subbed.
Thank you so much that is awesome to hear
This what I was looking for a whole day thanks man
No problem mate
Congrats on 1k !!! Love your videos!
Thank you so much!!! Any suggestions for upcoming videos?
The EncodeAudio.exe don't start in windows 11. With what version of java was this created. (A Java Exception has occurred)
This video is great. However I've got a single question. How should I edit the code If I want to make it play when, for example an ultrasonic sensor detects something ?
Put the "startPlayback(sample, sizeof(sample));" in the loop after some if statement so it only starts playing when a condition is met like being close to the ultrasonic sensor. Hope this helps!
EncodCode is not running on my computer. What should I do to convert mp3 file into array code for arduino?
Same to me😭😭😭😭😭😭😭😭😭😭 windows trouble shooter is telling it is incompatible file.
Hello brother, this encoder application is not available in the drive ..so could please send a new drive link consisting of this application.. please brother it is very important
Im using this to put sound into my Lego Saturn V display, thanks a lot dude!
Thats awesome to hear! Do you have a video of this? I would love to see it
Can you write the code with button added, so that reset button does not have to be pressed?
Is there a way to change it from the 11 digital pin to others?
Nice video! But, can I use any speaker? Like I has a 3W speaker. It will kill the arduino? Or I have to use a relay or something?
Awesome video man, is there any way to use multiple speakers and chose which one plays the sound?
For example: if i want to play sound_1 i want to only play it on speaker_1 and if i want to play sound_2 i want to only play it from speaker_2
Hi, can this library be used with a sketch that uses servos? And would the file have to be added to in a existing folder or be used in the same sketch?
Hello, I haven't tried yet but I need to ask, is it possible to use the PCM Library to play multiple audio files in one loop? For example play audio1, then a delay, then audio2, then a delay, and audio1 again?
Can't think of any reason why this would not be possible as long as your audio files aren't bigger then the available memory.
Thnx allot! This is perfect for my Ironman helmet. I will put some jarvis audio files into it!
What speaker are you using? Thanks for this btw
It's an old laptop speaker however every 3 watt speaker should work
@@JustBaselmansYT Thank you so much!
This is an amaizing tutorial, thank You a lot! But, I have a question. It only plays about 2-3 seconds of the file. How to You think I could fix it? Thanks in advance!
Hi, may I know if i am using mac, how can i encode the audio instead of using encodeaudio?Thank you!
Did you find a solution please?
Nice vid. Thanks for the tutorial.
Though, the EXE file just throws a java error "A Java Exception has occurred."
Do you knw how to fix it by any chance?
Thanks :D
Same problem
@@noahv1 Over 3 months later, I still didn't find a solution :/
@@TheFuturistPodcast download latest version of java maybe
@@TheFuturistPodcast Just download Java worked for me
Worked with latest java update
That's fantastic work.....do you have any idea for making a rc car or model railway sound genrator ?....i mean when we give throttle, basically spin the potentiometer then it gives acceleration/pick up sound like real one's ,otherwise it stays on idel....just wanted some help for my model railway project....
I made this for a pokeball with sound I am currently working on but using this for a model railway als sounds awesome!😍
@@JustBaselmansYT glad to hear that.... waiting for that video....keep it up👍😀
Which speaker?? i mean how many ohms/watt(idk if these are the units)??
I think it's a 3 watt speaker
Goedemorgen. Kun je mij misschien helpen? Ik wil via Arduino met een Gyro in een elektrische auto geluid maken. Is dit mogelijk zo ja, hoe kan ik dit maken? Ik ben echt een behoorlijke leek met Arduino. Hoor graag van je. Thanks!
Wat wil je precies in de auto meten? Probeer eerst met enkel de gyroscoop in de auto te kijken of je het gewilde signaal kan meten door alle gyroscoop data te plotten
@@JustBaselmansYT bedankt voor het reageren. Ik zou graag geluid willen hebben via een losse speaker dat wanneer ik het gaspedaal intrap er auto geluid uit de speaker komt. De auto is elektrisch en dus stil.
@@RebelDrifter ik zou het zelf denk ik oplossen met een knop op het gaspedaal die het geluid afspeelt maar je kan idd eerst testen of je een fatsoenlijk signaal kan krijgen door gebruik van een gyroscoop zoals bijvoorbeeld de mpu6050, in dat geval probeer eerst simpel een threshold te zetten en dat wanneer je boven die threshold komt dat je dan een led aanzet. Het geluid zelf is niet zo heel moeilijk daarna.
@@JustBaselmansYT Bedankt. Ik zal eens kijken of dit gaat lukken. Is het eventueel mogelijk dat ik jou inhuur? Uiteraard wil ik ervoor betalen. 😁
@@RebelDrifter uhm kan je mij eventueel benaderen via instagram? Dan kunnen we het hierover hebben @justbaselmans, maar ik denk eigenlijk niet dat jij mij zoveel nodig hebt😉
it doesn't work on arduino pro micro, any suggestions?
What is the string format called you converted the mp3 to, because I use linux and youre exe doesn't work there, thanks btw good video.
how exactly were you expecting to run an *Windows executable* on Linux?
@@antkoos It's actually really easy using CrossOver
one buzzer plays it very low and slow for 2 seconds and stop, big buzzer plays high tune for 3 seconds and stop,
is there anyway to fix this problem
the slow playback looks sounds like a converting problem when you are making it a wav. Buzzers not able to play it would be an powering issue, are you using an arduino uno and cable to your pc?
@@JustBaselmansYT yes sir! i cabled it to the PC and tried!
coz you did great work on the video, thank u for your help o7
So does method 1 not work for mps's? Just for built in sounds?
Hi, it’s there anyway I can have the audio play as soon as the chip gets power? I wanna power the Chip from my Arduino when it’s running a program. I have it set up whenever my Arduino gets power it starts the program, was wondering if I can do the same with the chip. A little hard to explain but if there’s anyway I can get into contact with you I’d appreciate it. It’s a small project but I’m very new to Arduino
the programm already does that, i plays it once it gets power for one time and then stops
hi , love it great job, is there a way to play the sound when pressing a switch? like a horn or a mini sampler, many thanks
how do you mean pressing a switch? I am not 100% sure what you mean but i think you could do this by placing the line "startPlayback(sample, sizeof(sample));" after some if statement when a switch is toggled.
@@JustBaselmansYT many thanks 🙏
@@JustBaselmansYT Any chance you could do a detailed tutorial to this question above? I am new to the nano, and i'm trying to create a handheld sci-fi scanner out of a cool designed mens shaver. I hollowed out the shaver all ready for the internals. Just need the tutorial for the sound. I know how to do the static & blinking lights with a simple switch. But when the switch is pressed a single scanning sound loops, until the tactile switch is released.
Nice Video. One question: Can I change the Pin for the Speaker
Nevermind, its Pin 11 but you could edit it inside of the library
@@CaptainDrakeEye make sure to use the pins suitable for outputting PWM signal, because (at least I thinks so) his code uses PWM to control the speaker
@@antkoos Thanks man
@@CaptainDrakeEye no problem
the tool used to encode into arduino is not working whats the problem ??
I have a question, For my project, I need it to play when it receives power not when the button is clicked. How would I make it do this? Thank you very much
Have u figured anything out I need to do the same
The button just resets the microcontroller, the playback happens at the power-up too
@@antkoos thanks
@@Awsometurtle20 was I seriously not late? your reply was 1 month old, after all 😅
@@antkoos no ur good lol the project is on hold I haven’t bought anything lol i found another way to do it too but I think arduino is a better way to do it, the alternative is a birthday card playback module but it needs a power source and a button to actually play with the arduino it plays when powered like you said which means less stuff to worry about
my school doesnt allow phones or mp3 things so you know what i had to do :)
I was trying to play an actual song, it made me laugh so hard when I heard how bad it sounded XD
What speaker are you using in the video?
This is a speaker I got out of an old computer I think it is a 3 watt speaker
how many kilo bits or bytes the file was after you converted it?
Isn't working for me it is a really short sound instead of the full music list.
Would it also work if the sampled array was In a text file on the computer and the arduino would read from that file to play sound longer?
just add the playing function into the loop, or a while loop or if you want to play it certain times, you can write a "for" cycle for it.
Hey Thank you so much, that was so clear but in my case i couldn't find a way to convert the audio note that i'm using macOS and the EncodeAudio not working for me
To be honest I am not sure how to transfer this for mac users, however I did upload a more recent video on audio for the arduino that's shows 3 different ways of getting audio maybe one of these is more useful for you
@@JustBaselmansYT I really appreciate the efforts you’re making to explain this, and i did find a way to do it on Mac through installing VMware and run windows to transfer the audio using the windows software and hopefully they will support Mac version on the upcoming releases.
@@iliesspace awesome to hear! good luck with your project ^^
Is audacity good to use? I heard they put something bad in the recent versions or version 3.x. I think it was Spyware.
I haven’t heard such thing and I am happy with it but definitely do your own research, formatting an audio file is also possible in other sound editors.
@@JustBaselmansYT I think it might have been big news maybe a year ago. Who knows maybe they removed said changes by now. I personally use ffmpeg.
nice but i have a problem i want to change the pin to numer 3 and it can"t pleased help my
I am not sure if that is possible with this library, did not need it myself and couldn’t find a solution with some google searches. Something that is always an option is to use two Arduinos that communicate with each other it is not very difficult and I guess there are many tutorials explaining how to do it.
@@JustBaselmansYT yes the reason is because I want to use a attiny chip
Thanks for the video but I can't open AudioEncode, Windows always tells me that javaw.exe is missing... Is it still working for you ?
you need to install java on your computer
Can we add external buttons to this circuit? and can we assign different sounds to these buttons? how can I do it
Put the "startPlayback(sample, sizeof(sample));" in the loop after some if statement so it only starts playing when a condition is met like having pressed a button. Hope this helps!
Would this work if I’m using a passive buzzer instead of a speaker?
Yes, it would
instead of using transistors, can we use a mini amplifier module?
I have little experience with this but that should be possible
I have the arduino and speaker setup playing audio fine, but when I switch to pin 11 and run this file with my sound in it nothing happens. I checked and my code is the same as yours except mine has different sound obviously. Any suggestions?
I thinks his code uses PWM to control the speaker, so you would need to check what pins could output a PWM signal on your arduino
can I do it in any speaker?
Could you comment the log number file thing used in the sketch
can we change the playing pin to some other pin except pin 11
what kind of speaker did you use?
An old pc speaker but any 3 watt speaker should work
Hi! Can I make the audio play in a loop rather than once?
Sure, just place "startPlayback(sample, sizeof(sample));" somewhere in the loop instead of in the setup
whats an arduino ? 2:03
where can i buy one?
I tried this within a loop not working. The output audio is not the actual audio,only beeps but I am getting the actual output with code in the setup how do I fix this?
Is it a few beeps over time or only one beep everytime you run the code?
@@JustBaselmansYT it will work if add a delay
what if the audio file is bigger than the ram size 🙂
Use a bigger arduino like an arduino mega ;)
@@JustBaselmansYT pin 24 isnt working tho with audio
Can I make it play longer music?
Yes should be possible as long as the Arduino memory isn't full if you want to play even longer music I would advice you to try option 2 of my newest Arduino video
Is this compatible with all arduino types
What arduino board did you use?
i used an arduino nano
@@JustBaselmansYT OK thank you!
hey im using this project but windows cant open the encodeaudio.exe could you help me pls (pls respond fast urgent)
Hi, did u find a solution? I'm facing the same issue
Hii can we make it to play 4 to 6 different sounds based on some conditions
I do not see why not ;)
is this encode program good
Wait can you use an active buzzer
hello, whenever i press EncodeAudio.exe it gives me an error. can anyone help?
I don't know if this helps as it has been a bit since you commented this, but if your error is that it is missing javaw.exe, then an easy fix is to download/re-download java. That was my error at least and how I fixed it.
Hi, I have a problem. My app doesent wanna open PCM playback.
While this may be a tedious way to do it, one way is to open the file with notepad or notepad++ then copy it to the arduino ide. I think the reason why it has trouble opening it is due to it being a pde file not an ino file. If you imported the library, the file itself should be in the arduino library under PCM -> examples -> playback.pde, if you right click it and select open with then notepad, you can then copy the code into arduino. This may be a bit much, but it worked for me. Unsure if this helps.
0:25, the app at the top is a Torrent LMAO
will this work on the MKR wifi 1010
Whenever I load the encode audio app it comes up with an error saying “ windows cannot find Javaw.exe” how do I fix this please help
Never mind just had to install Java I was just being a nutcase
Which java
I'm getting the same error how did you fix it
@@ianhayden2839 wdym which java
Hi all, first of all many thanks to "Just Baselmans" for that great video. It is short and good explained, you can find everything you need in that video. Anyhow.
I had the same problem with the "EncodeAudio.exe" program. I am mainly using "Windows 10"and on my older Laptop I am using "Windows 7". I tried following: right mouse click to the file "EncodeAudio.exe" then select the properties, then change to the tab "compatibility". Here under the section "compatibility mode" there are different software options (like Win7, Win8, Win95, Win98,...) -> just select these options step by step, until one of them is working fine. In my case it helped at least for Win-7 OS but not for Win-10 OS. Therefore I was looking here again, in the hope, that I can find the solution under the comments for Win 10, but unfortunately I could not find 😞. Can anybody help maybe? Many thanks in advance.
not working,where to plug
What to do if want to play it again again over again automatically
Put the line in the loop
what is the name of the speaker please so i can buy it
This speaker is from an old laptop but any 3watt speaker will work
EncodeAudio.exe doesnt work for me :(
Hi, did u find a solution? I'm facing the same issue
@@jiaqili9104 I found a solution in using Processing aswell as Arduino IDE to play whatever audio. Maybe this solution works only for my particular case, but I essentially turned my PC into an arduino extention. Just save the audio you want to play on your computer and write a program in Processing that registers the arduino input and outputs audio on your computer. ruclips.net/video/NhyB00J6PiM/видео.html
where i can download encodeaudio?
won't work when you try to use arduino micro
That is very interesting Just. Lots of potential with Arduino. 🧔🏻👍
wat bedoel je met DE files ?
Can I do without both transistor and sd card?
yes just connect it
bro why did you even delete the arduino mp3 folder man,cant you just put onto a mediafire link then we all fine?
How can ı this code work on esp32?
Are u coming back?
I hope I do but I dont know if it will be the same kind of content, hope to inform you somewhere in the upcoming month
javaw.exe does not exist (also a shell problem)
You forgot to install java
encodeaudio not install plz sir hlp
can buzzer run this?
No
Does this work on arduino uno
yes definitly
Yes but HOW do you do this
By following the steps in the video :) I'm not sure if I understand the question
transistor*
Where is audacity?
It's a software that you can download
All i hear is a clicking sound :(
Do you power your Arduino from your PC or from a external power source?
@@JustBaselmansYT PC
Did you already try converting another sound because the conversion does alter the audio by a lot maybe the clicking is the only thing left from that specific piece of audio
@@JustBaselmansYT Yeah I even tried it with the default sound and still was just clicking.
javaw.exe is missing
did you find an answer pls?
Dang it All I hear is silence
oh ik zie nu laat maar
sorry but encodeaudio for mac...
Ok I subscribe
Hey is there a way to make it play when powered up???
You can place all the code in the setup I think