Git Product home page Git Product logo

gifyourworld's Introduction

Gif Your World

A sound powered gif generator

Using the Giphy and wordassociations.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 Associations 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.

Find a functional version of the application here: https://bit.ly/gifyourworld

To run the application on your computer:

  1. Register for your own API keys on https://developers.giphy.com/ (GIPHY API KEY) as well as https://wordassociations.net/en/api (WORD ASSOCIATIONS API KEY)

  2. Clone the project

  3. Open the sketch.js file within the projectMain folder in a text editor

  4. Enter your API keys in the variables labeled "API"

  5. You can now run the project on a local server and the application should work in your browser

  6. To calibrate thresholds for your microphone, use console.log(mic.getLevel()) to measure microphone levels and find the right thresholds for you

  7. Change input words corresponding to mic levels in the high mid and lowEnergy variables at the top.

Enjoy!

gifyourworld's People

Contributors

isaacwellish avatar nicknormal avatar

Watchers

 avatar  avatar

Forkers

nicknormal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.