vincentaabc
vincentaabc

Reputation: 1

Processing shows there's no class named AudioClip

I'm trying to use SoundCipher library in Processing to make some music pieces,

however, when I run the example of library, some of them showed

"can't find a class or type named AudioClip"

error message

Do I miss some important package or library to import?

here's the example code provided by library creator.

import arb.soundcipher.*;
SoundCipher sc = new SoundCipher(this);
SCScore score;
AudioClip ac;

void setup() {
  score = new SCScore();
  ac = sc.loadAudioClip("plink.aif");
  score.addCallbackListener(this);  
  score.tempo(100);

  for(int i=0; i<4; i++) {
    score.addCallback(i / 4.0, 3);
  }
  score.play();
}

// Parse the callback message triggered during score playback.
public void handleCallbacks(int callbackID) {
 if(callbackID == 3) {
    sc.playAudioClip(ac);
 }
}

Upvotes: 0

Views: 85

Answers (1)

Kevin Workman
Kevin Workman

Reputation: 42174

Questions like these are best answered by checking out the reference for the library you're asking about. The reference for SoundCipher can be found here.

Looking at that, you'll notice that the AudioClip class is in the java.applet package. So you'll have to import it as well:

import java.applet.AudioClip;

Upvotes: 1

Related Questions