MouseDragMethod(myFunction) - calls myFunction anytime the mouse is dragged MoveClickMethod(myFunction) - calls myFunction anytime the mouse is clicked If you've taken a JavaScript course on CodeHS before, you may be familiar with mouse event listeners: mouseMoveMethod(myFunction) - calls myFunction anytime the mouse is moved audioChangeMethod is an event listener that listens for a special type of event - the given audio file changing frames. The key to step 4 is the use of audioChangeMethod. We update the text to show the current frame anytime song changes frames.We create the Audio object, stored in a variable named song.Let's start off with a program that just prints out each frame in the audio file: And the final numbers in the list represent how loud the high notes are being played. The middle numbers represent how loud the mid-range notes are being played. The first numbers in the list represent how loud the low notes are being played. A frame represents a single moment in the song, and each frame is a list of numbers that describe the notes being played at that moment. So what do these numbers look like? We can picture a music file as a series of frames. When a computer plays a music file, it's simply reading all the numbers in that file, and making noises through the speakers based on the numbers it reads. Digital means stored as digits, aka numbers. The big idea here is that the music playing through your speakers is just DATA.Īll information stored in a computer is stored as digital data. Great! We have our music playing, but how can we visualize that music?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |