2013-05-27 3 views
-3
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(); 
} 
} 

이 도움을 주시기 바랍니다 자사의 뒷모습가 ... THER 오디오 이유Uncompilable 소스 코드 - 잘못된 SYM 유형 : 내가 실행할 때 java.io.File.getSampleV

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: java.io.File.getSampleValueAt 
at Prepro.filterpanitha.main(filterpanitha.java:41) 

난 아무 생각이 말한다 형식 어떻게해야할지 모르겠다면 ... 도와주세요

+0

라인 41은 어느 라인입니까? –

답변

5

이 예외 은 일부 클래스가 컴파일되지 않아도 프로젝트/코드를 실행할 수있는 IDE를 사용할 때 나타납니다 (오류로 인해). 암호). 코드를 수정하고 프로젝트를 실행하기 전에 오류가 없음을 제안합니다.

또한 java.io.File에는 setSampleValueAt()이라는 방법이 없습니다. 이 때문에 코드가 컴파일되지 않습니다.

2

귀하의 오류가이 줄 방법 ​​getSampleValueAt을 제공하지 않습니다

int value = file.getSampleValueAt(index); 

File입니다.

관련 문제