Johnson
Joined: 27 May 2014 Posts: 9 Location: china |
Posted: Tue May 27, 2014 4:21 am Post subject: how to setup in android |
|
|
Hi, my friends,
thank you for your sdk in ir converting. It works in Java SDK 1.7.
My program some like below,
--------------
double[] data1 = {6032, 1955, 600, 1105, 568, 1112, 573, 516, 608, 510, 678, 1002, 600, 517, 675, 1003, 597, 519, 653, 464, 678, 1005, 598, 518, 674, 1006, 595, 1109, 573, 516, 676, 1006, 597, 520, 673, 1007, 594, 1112, 573, 1109, 576, 513, 678, 437, 682, 435, 655, 1028, 597, 517, 3665, 3601, 603, 516, 594, 521, 680, 1001, 601, 512, 645, 1032, 600, 515, 656, 1025, 598, 517, 653, 460, 648, 468, 650, 463, 654, 1025, 649, 1032, 602, 1104, 569, 519, 651, 1027, 595};
int iLen = data1.length;
int iEven = iLen;
if( iLen%2==1 ) iEven = iLen+1;
double data [] = new double[iEven];
if( iLen%2==1 ){ // lengs are odd
System.arraycopy(data1, 0, data, 0, iLen);
data[iLen] = data[iLen-1];
}else{
System.arraycopy(data1, 0, data, 0, iLen);
}
System.out.println( "len:" + data.length );
Wave wave = new Wave(19000, data, 44100, 8, 2, false, false, false, false);
wave.export(new File("topway_right.wav"));
wave.play();
-----------
it works for my device.
However when I want to use the code in my android, Eclipse complain that "The type javax.sound.sampled.UnsupportedAudioFileException cannot be resolved. It is indirectly referenced from required .class files
".
I guess it should be the android sdk issue.
Who can figure me out?
Thank you again. _________________ Lai |
|