JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

how to setup in android

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Beginners
View previous topic :: View next topic  
Author Message
Johnson



Joined: 27 May 2014
Posts: 9
Location: china

                    
PostPosted: Tue May 27, 2014 4:21 am    Post subject: how to setup in android Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Johnson



Joined: 27 May 2014
Posts: 9
Location: china

                    
PostPosted: Tue May 27, 2014 4:23 am    Post subject: android Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Barf
Expert


Joined: 24 Oct 2008
Posts: 1415
Location: Munich, Germany

                    
PostPosted: Tue May 27, 2014 1:10 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Johnson



Joined: 27 May 2014
Posts: 9
Location: china

                    
PostPosted: Tue May 27, 2014 8:23 pm    Post subject: nblibraries.properties content Reply with quote

Thank you Barf.

I am building the source with ant, but fail.

How to create the content for lib/nblibraries.properties?
_________________
Lai
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Beginners All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control