不可编译的源代码 - 错误的sym类型:java.io.File.getSampleV [英] Uncompilable source code - Erroneous sym type: java.io.File.getSampleV
问题描述
import java.io.File;
import java.io.FileInputStream;
// import javax.swing.JFrame;
public class filterpanitha {
// public void graph(){
//}
/ **
* @param args
* /
public static void main(String [] args){
//首先,从.wav格式的声音文件中获取数据到您的程序
//您将不得不修改下面一行指向你自己的文件
// String fileName =C:\\Huhns\\Teaching\\CSCE145\\Code\\Noise3\\ preamble.wav;
FileInputStream fileInputStream = null;
档案档案=新档案(C:\\\\\ Users \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\);
//接下来,打印声音以找出样本中的长度
System.out.println(file);
//以下两个方法调用获取声音样本的值
// index 1000,然后将其值设置为原始值的一半。
int index = 1000;
int value = file.getSampleValueAt(index);
file.setSampleValueAt(index,value / 2);
//下面的循环将每个声音样本设置为其原始值的两倍
for(int n = 0; n value = file。 getSampleValueAt(N);
file.setSampleValueAt(n,value * 2);
}
//收听声音
//sound1.play();
$ / code $ / pre
当我运行它的时候请帮助
pre $ 线程main中的异常java.lang.RuntimeException:不可编译的源代码 - 错误的sym类型:java.io.File.getSampleValueAt
在Prepro.filterpanitha.main(filterpanitha.java:41)
我不知道为什么它的pooping如果是这样的话,那么...请帮助解决方案
这个例外 java.lang.RuntimeException:当使用一个允许你运行项目/代码的IDE时,即使某些类没有被编译,也会看到不可编译的源代码
码)。我建议修复你的代码,在运行你的项目之前你没有任何错误。
另外, java.io.File
从来没有方法 setSampleValueAt()
。这是导致你的代码永远不会编译的原因。
import java.io.File;
import java.io.FileInputStream;
//import javax.swing.JFrame;
public class filterpanitha {
//public void graph(){
//}
/**
* @param args
*/
public static void main(String[] args) {
// First, get the data from a sound file in .wav format into your program
// You will have to modify the following line to point to your own file
// String fileName = "C:\\Huhns\\Teaching\\CSCE145\\Code\\Noise3\\preamble.wav";
FileInputStream fileInputStream = null;
File file = new File("C:\\Users\\sudharshan_03713\\Desktop\\audio\\1A5.wav");
// Next, print the sound to find out its length in samples
System.out.println(file);
// The following two methods calls get the value of a sound sample at
// index 1000 and then set its value to half of the original.
int index = 1000;
int value = file.getSampleValueAt(index);
file.setSampleValueAt(index, value / 2);
// The following loop sets every sound sample to be twice its original value
for (int n = 0; n < file.getNumSamples(); n++) {
value = file.getSampleValueAt(n);
file.setSampleValueAt(n, value * 2);
}
// Listen to the sound
//sound1.play();
}
}
please help when i run its says
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: java.io.File.getSampleValueAt
at Prepro.filterpanitha.main(filterpanitha.java:41)
i have no idea why its pooping up ...is ther any audio format i need to look in to if so how ...please help
This exception java.lang.RuntimeException: Uncompilable source code
is seen when using an IDE which allows you to run your project/code, even if some classes are not compiled (due to errors in code). I suggest fixing your code and you have zero errors before running your project.
Also, java.io.File
never have the method setSampleValueAt()
. This is what causes your code to never compile.
这篇关于不可编译的源代码 - 错误的sym类型:java.io.File.getSampleV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!