Method return exception in meanBufferList.add(Float.parseFloat(df.format(frameVal / mChannels)));
because DecimalFormat df = new DecimalFormat("#.#####"); need to use with different locales
For me works: meanBufferList.add(Float.parseFloat(df.format(frameVal / mChannels)..replace(',','.')));
here:
`public ArrayList loadAndReadAsListWithOffset(String path, int sampleRate, int readDurationInSeconds, int offsetDuration)
throws IOException, WavFileException, FileFormatNotSupportedException {
float[][] magValueArray = readMagnitudeValuesFromFile(path, sampleRate, readDurationInSeconds, offsetDuration);
DecimalFormat df = new DecimalFormat("#.#####");
df.setRoundingMode(RoundingMode.CEILING);
int mNumFrames = this.getNoOfFrames();
int mChannels = this.getNoOfChannels();
// take the mean of amplitude values across all the channels and convert the
// signal to mono mode
float[] meanBuffer = new float[mNumFrames];
ArrayList<Float> meanBufferList = new ArrayList<Float>();
for (int q = 0; q < mNumFrames; q++) {
double frameVal = 0;
for (int p = 0; p < mChannels; p++) {
frameVal = frameVal + magValueArray[p][q];
}
meanBufferList.add(Float.parseFloat(df.format(frameVal / mChannels)));
}
return meanBufferList;
}`
Method return exception in meanBufferList.add(Float.parseFloat(df.format(frameVal / mChannels))); because DecimalFormat df = new DecimalFormat("#.#####"); need to use with different locales For me works: meanBufferList.add(Float.parseFloat(df.format(frameVal / mChannels)..replace(',','.')));
here: `public ArrayList loadAndReadAsListWithOffset(String path, int sampleRate, int readDurationInSeconds, int offsetDuration)
throws IOException, WavFileException, FileFormatNotSupportedException {