Last active
          September 10, 2018 07:08 
        
      - 
      
- 
        Save jaegonlee/364cedf94e08c99b4d1a8ef50603a279 to your computer and use it in GitHub Desktop. 
    processing audio input example
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import processing.sound.*; | |
| AudioIn input; | |
| Amplitude loudness; | |
| void setup() { | |
| size(640, 360); | |
| background(255); | |
| input = new AudioIn(this, 0); | |
| input.start(); | |
| loudness = new Amplitude(this); | |
| loudness.input(input); | |
| } | |
| void draw() { | |
| float volume = loudness.analyze() * 350; | |
| background(125, 255, 125); | |
| noStroke(); | |
| fill(255, 0, 150); | |
| ellipse(width/2, height/2, volume, volume); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment