I have a Java application that computes the MFCC coefficients of an audio file by reading it into an AudioInputStream object and then writing it into a Byte array.
public double[] convertsignal(File signalfile) throws UnsupportedAudioFileException, IOException {
AudioInputStream audioInputStream=AudioSystem.getAudioInputStream(signalfile);
ByteArrayOutputStream out=new ByteArrayOutputStream();
int read;
byte[] buff = new byte[2048];
while ((read=audioInputStream.read(buff, 0, 2048)) > 0)
{
out.write(buff, 0, read);
}
out.flush();
byte[] audioBytes = out.toByteArray();
As the Java sound library is not supported in Android the above code containing the AudioInputStream object does not work in an Android application. Is there a corresponding way to do the above in Android?