Because certain other languages I'm used to currently lack features I require, I'm building a semi-complicated Java Applet to listen to the audio input (either mic or line-in) of a computer, store 0.5 seconds of data, analyze it, and return a string.
I'm having difficulty setting up a repeating counter, which should be called every 0.1 of a second. This is just a test.
Here is my code: (indented with tabs, but they haven't shown up on here)
import java.applet.*;
import java.net.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*; // for ByteArrayOutputStream
import javax.sound.sampled.*;
public class test3 extends Applet{
public void init(){
boolean stopCapture=false;
ByteArrayOutputStream byteArrayOutputStream; // Might want to set this as a normal array
TargetDataLine targetDataLine; // Does this select the audio input?
AudioInputStream audioInputStream; // Set up an audio input stream?
SourceDataLine sourceDataLine; // Or does this select the audio input?
ActionListener recPoller = new ActionListener();
Timer poller = new Timer(100, recPoller);
poller.start();
// captureAudio(); // Calls the audio capture function
String msg="1";
}
public class dataStore{
int tmr=0;
}
public class something implements ActionListener{
public void actionPerformed(ActionEvent event){
try{
//getAppletContext().showDocument(new URL("javascript:doAlert(\"" + dataStore.tmr +"\")"));
//dataStore.tmr++;
}catch(MalformedURLException me){}
}
}
private void captureAudio(){
try{
// Write something later to catch audio data
}catch(Exception e){}
}
}
I keep getting an error saying
"test3.java:17: java.awt.event.ActionListener is abstract; cannot be instantiated"
Does anybody know what this means or how to fix it?
SUN ->

<- me