Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How do I record the audio input to a new audio render using minim

$
0
0

So, i´ve been tryng to make the minim recorder to record the audio from the Audioplayer object when is played without any succes.

Something like the combination of this 2 examples :

http://code.compartmental.net/minim/audioplayer_method_play.html http://code.compartmental.net/minim/minim_method_createrecorder.html

I´ve found similar threats but with no anwer to it :

https://forum.processing.org/one/topic/minim-how-to-record-minim-s-output.html

The audio plays just well but the recorder comes out empty. If I try the "createrecorder" example it works on recording the sounds created by minim, but I need it to record the sound getting them from the audio player. This is my greates attemp :

import ddf.minim.*;
import ddf.minim.ugens.*;

Minim         minim;
AudioOutput   out;
AudioRecorder recorder;
AudioPlayer sonido;
void setup()
{
  size(512, 200, P3D);

  minim = new Minim(this);

  out = minim.getLineOut();
  sonido = minim.loadFile("fijo2.wav");
  sonido.loop();

  recorder = minim.createRecorder(out, "myrecording.wav");  
  textFont(createFont("Arial", 12));
}

void draw()
{
  background(0); 
  stroke(255);
}

void keyReleased()
{
  if ( key == 'r' ) 
  {
    if ( recorder.isRecording() ) 
    {
      recorder.endRecord();
    }
    else 
    {
      recorder.beginRecord();
    }
  }
  if ( key == 's' )
  {
    recorder.save();
    println("Done saving.");
  }
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles