Results 1 to 4 of 4
- 04-20-2011, 05:20 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
why i can not compile? please help
public class project4aczhang34
{
public static void main (String[] args)
{
String fname = FileChooser.pickAFile();
Sound s = new Sound (fname);
System.out.println ("Number of samples in the sound: " + s.getLength());
System.out.println ("Number of samples per second: " + s.getSamplingRate());
double lengthInSeconds = s.getLength() / s.getSamplingRate();
System.out.println ("The length in seconds of the sound: " + lengthInSeconds);
String input;
input = SimpleInput.getString ("Please type the message you want to encode into the your sound file:");
System.out.println(input);
int digit1, digit2, digit3;
int temp;
//int array[ ] = new int[100];
int array[ ]= new int[input.length()*3];
for (int i=0; i<input.length(); i++)
{
char ch = input.charAt(i);
int asciiNum = (int) ch;
System.out.println ("For Character:" + ch + "int ascii value is;" + asciiNum);
digit1=asciiNum % 10;
temp = asciiNum /10;
digit2 = temp %10;
temp = temp /10;
digit3 = temp%10;
System.out.println ("The digits are:" + digit1 + "," + digit2 + "," +digit3);
array [i*3+0]=digit1;
array [i*3+1]=digit2;
array [i*3+2]=digit3;
Sound NewSound = codesound(s,array);
NewSound.explore();
}
public static Sound codesound (Sound s, int [ ])
{
SoundSample sampArr [ ]= s.getSamples();
SoundSample samp;
int numberOfSamples = s.getLength();
Sound s1= new Sound (numberOfSamples);
SoundSample sampArr1 [ ] = s1.getSamples();
SoundSample samp1;
int index;
int sampVal, sampVal1;
for (index =0; index <sampArr1.length; index ++)
{
samp = sampArr [index];
samp1 = sampArr1 [index];
sampVal = samp.getValue();
int digit4;
digit4 = sampVal % 10;
int modAmpValue;
modAmpValue = sampVal - digit4;
if (sampVal >=0)
sampVal1 = modAmpValue + array[index];
else
sampVal1 = modAmpValue - array[index];
if (sampVal >32767)
sampVal1 =sampVal1-10;
else if (sampVal <-32767)
sampVal1 =sampVal1+10;
else
sampVal1= sampVal1;
samp1.setValue (sampVal1);
return s1;
}
}
}
}
- 04-20-2011, 05:31 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
1) Is your computer plugged in the AC?
2) Do you have the JDK installed?
3) No path issues?
4) Did a fuse blow? (see 1)
5) etc.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-20-2011, 05:41 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 36
- Rep Power
- 0
i think you miss a {or }
anyways use code tags and post the error you get
-
Similar Threads
-
would this compile?
By stringkilla in forum New To JavaReplies: 10Last Post: 10-24-2010, 03:27 PM -
Can't Compile
By sidk47 in forum JavaServer Pages (JSP) and JSTLReplies: 7Last Post: 06-15-2010, 04:43 PM -
Help with compile
By mr_anderson in forum NetBeansReplies: 7Last Post: 06-10-2010, 04:03 AM -
doesn't compile?!
By jon80 in forum New To JavaReplies: 8Last Post: 06-14-2008, 05:42 PM -
Not able to compile
By bugger in forum New To JavaReplies: 2Last Post: 01-09-2008, 10:13 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks