你好我创建了这个代码来显示音频波形,我无法在图形线图中查看它们因为有很多数字。你能帮帮我吗?以下是我的代码......
// take a file from table (item selected) ; call extractWaveForm and take point that I want to plot; draw linechart
public void plotAudio() throws IOException, UnsupportedAudioFileException, WavFileException {
if(Table1.getSelectionModel()!= null){
extractedData = extractWaveform(files.get(Table1.getSelectionModel().getFocusedIndex()));
XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();
series.setName("My Data");
for(int i =0; i<extractedData.length; i++){
series.getData().add(new XYChart.Data<Number, Number>(extractedData[i],RATE));
}
lineChart.getData().add(series);
}
}
// call extract to WaveFormExtract class that extract the point.
public double[] extractWaveform(File file) throws IOException, UnsupportedAudioFileException {
return new WavFileExtractor().extract(file);
}