how to setup in android

This is the JP1 beginners forum. There's no such thing as a stupid question in here, so post away, but this forum is just for JP1 users and people considering JP1, non-JP1 users please use the appropriate forum above!

Moderator: Moderators

Post Reply
Johnson
Posts: 9
Joined: Tue May 27, 2014 3:08 am
Location: china

how to setup in android

Post by Johnson »

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
Johnson
Posts: 9
Joined: Tue May 27, 2014 3:08 am
Location: china

android

Post by Johnson »

Maybe some difference from Android,

in Java we offen use "import javax.sound.sampled.AudioFormat;", but in android need to use "import android.media.AudioFormat;"
Lai
Barf
Expert
Posts: 1523
Joined: Fri Oct 24, 2008 1:54 pm
Location: Munich, Germany
Contact:

Post by Barf »

Well, everything that is supposed to work seem to work. What does not work is compiling/running on Android, because the JDK you are using on Android does not implement everything that the Oracle JDK implements. Sorry, I cannot give any substantial help here. An Android forum might be better.

Please tell us if you have success.
Johnson
Posts: 9
Joined: Tue May 27, 2014 3:08 am
Location: china

nblibraries.properties content

Post by Johnson »

Thank you Barf.

I am building the source with ant, but fail.

How to create the content for lib/nblibraries.properties?
Lai
Post Reply