Visualizing FFT values on a 3D object using microphone input from Android Device.

edited November 2016 in Android Mode

Hello,

I am having trouble with an audio reactive project I am working on. So far I have a 3D environment that is using the Minim library to analyze FFT values drawn from the microphone of my PC to change the size of the objects in the environment. I am trying to get this effect to work on my Android phone with the "Google Cardboard" library (http://android.processing.org/tutorials/cardboard_intro/index.html). I am able to display the environment and look around perfectly in VR, however I am unable to analyze the microphone input from my phone. I understand this is not possible with Minim, and I have spent hours looking for, and trying various alternative solutions. I am relatively new to programming and many explanations I have found are very advanced. Is there a simple way to achieve this?

Thank you so much.

Tagged:

Answers

  • I am trying to get this effect to work on my Android phone

    The link shows a VR environment example but I don't see the reference to the FFT. What do you want to get from the FFT? What effect are you looking to implement? In other words, what minim functions were you thinking in using?

    Kf

  • edited November 2016

    ``I have the following code which changes the size of a sphere based on in.right.get(i+1)*50. I am trying to get something working like this on the Android device so I can implement it in VR. I can get the Sphere to display just fine, however I am just having trouble with the audio portion. I have been trying to follow this link but am having trouble. https://forum.processing.org/one/topic/microphone-on-android.html

    Thank you!

        import ddf.minim.*;
    
        Minim minim;
        AudioInput in;
    
        void setup()
        {
          size(1500, 1500, P3D);
    
          minim = new Minim(this);
    
          // use the getLineIn method of the Minim object to get an AudioInput
          in = minim.getLineIn();
        }
    
        void draw()
        {
          background(#FAE928);
          stroke(#393939);
          strokeWeight(2);
    
    
          for (int i = 0; i < in.bufferSize() - 1; i++)
          {
            noFill();
            pushMatrix();
            translate(width/2, height/2);
            rotateY(radians(frameCount));
            sphereDetail(6);
            sphere(300 + in.right.get(i+1)*50 );
            popMatrix();
    
  • Did you try the audioInput example from the Ketai library?

    http://ketai.org/examples/audioinput/

    Notice that as fas as I know, minim kibrary doesn't work in Android.

    Kf

  • I encourage you to work in java mode and using minim to create a demo of your effect using FFT. This will give you a better understanding how to implement your code in Android mode. In java mode you will have the advantage of your code being executed faster and debugging will be less painful.

    Kf

  • edited November 2016

    @ThimothyThomasson===

    --you cannot use minim with the android mode

    --in order to capture the mic you have to use the AudioRecord class from android:: see here for more details https://developer.android.com/reference/android/media/AudioRecord.html

    -- with this class you (normally) can save your input then read it

    -- but you can also read it without saving using a buffer and an audio track

    -- as for applying fft in real time to that best way (as for me) is to use the tarsosdsp lib

Sign In or Register to comment.