Thanks a ton to Isaac who showed off this project on last week’s Show & Tell:
Using the Giphy and wordassocioations.net APIs, in conjunction with built in microphone capabilities in p5.js, this application can generate a never ending stream of gifs based on audio input.
The program takes a 3 second sample from the user’s computer mic and determines the “energy level” based on the loudness of the user’s environment. Based on predefined input words that are set to three energy level variables high, mid and low such as “walking”, “jogging”, and “sprinting”, the program will enter the corresponding input word into Gihpy’s API and spit out a random gif within the search for that word. For example if the energy level was high and the corresponding input word was “sprinting”, a search for sprinting would be entered into Giphy’s database and a random result would be selected. At this point, the program takes the selected word and using the Word Asssociations API, enters it into the database, returns ten results related the word, picks a word at random, enters it into a Giphy search. For example if the word “sprinting” was entered, after a sprinting related gif is shown, the word sprinting is searched through the Word Associations API, ten words related to sprinting are returned and one of them is chosen at random, say the word “tired” at which this new word is entered into a new Giphy search where a random gif is selected and shown. The process loops on for a minute until the microphone takes another 3 second sample of the user’s environment and starts the process from the beginning.
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, or even use Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for MakeCode, CircuitPython, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.