r/learnjavascript • • Mar 19 '21

My hand-made vanilla JavaScript audio visualizers :D (source code included)

358 Upvotes

23 comments sorted by

2

u/[deleted] Mar 20 '21

Thanks how can i implement this into a wordpress site, with it visualizing any audio stresming on the page

3

u/frank0117 Mar 20 '21

You would need to route that audio through this codebase or copy its source and connect it that way. It really depends what audio that page plays. I explain basics of how how manage audio nodes in my beginner level tutorial. Not sure if it would work also for YouTube music video for example. If I figure that out I will make another tutorial.

2

u/limeforadime Mar 20 '21

Awesome!

1

u/frank0117 Mar 20 '21

Thank you :)

2

u/playtrix Mar 20 '21

It's incredible really.

2

u/frank0117 Mar 20 '21

Glad you like it. I made many more this is just my top 10 of this batch :)

1

u/playtrix Mar 20 '21

You are talented Frank. Are you working as a dev now? I'm taking a boot camp next week. Hoping to break in as a dev.

3

u/frank0117 Mar 20 '21

Thank you. Yeah I work with JavaScript. Did the entire self taught thing in the past 5 years. Moved to London. Got a supermarket job and learned JavaScript from scratch after work. Took me 3 years to get my 1st dev job from the moment I started learning. It can be done much faster if you don't distract yourself by moving to a different country like I did ha. Good luck with your studies :)

1

u/playtrix Mar 20 '21

Thanks! Good job, you set a goal and stuck with it. I'm going to do the same.

2

u/frank0117 Mar 21 '21

You can do it if you keep learning. Most people give up too early

2

u/codeobserver Mar 20 '21

This is are super interesting visualizations!

1

u/frank0117 Mar 20 '21

Thank you. I tried to make each one with different techniques:)

1

u/[deleted] Mar 20 '21

That really cool :O

2

u/frank0117 Mar 21 '21

Thank you 😊

1

u/Neon101010 Mar 20 '21

This looks amazing! Thanks for sharing

1

u/frank0117 Mar 21 '21

Thank you. Glad you liked it

1

u/amadeusjustinn Mar 20 '21

This is brilliant. But I have to ask what is that long string that audioSource is set to?

1

u/darkersauru5 Mar 20 '21 edited Mar 20 '21

He converted the audio file to base64 encoding

2

u/frank0117 Mar 21 '21

Yup. I linked YouTube tutorial where I code it and explain every line of code. Browsers block audio files and images when you try to analyse them so converting images and sound files to base64 string bypasses built in browser CORS security that would otherwise block it

1

u/darkersauru5 Mar 21 '21

To bypass CORS you could also host the audio files on the same domain as the page you want them to appear on I believe, obviously that isn’t possible with Codepen (unless you’ve got a project set up)

1

u/amadeusjustinn Mar 22 '21

Oh I see. Thank you!

2

u/anti-gif-bot Mar 19 '21

mp4 link


This mp4 version is 89.88% smaller than the gif (579.21 KB vs 5.59 MB).


Beep, I'm a bot. FAQ | author | source | v1.1.2