问题描述
这是我跑的路线:
AudioInputStream clip1 = AudioSystem.getAudioInputStream(new File(wavFile1));
这是例外,我获得(来自LogCat中):
This is the exception I get (From LogCat):
ERROR / AndroidRuntime(311):java.lang.NoClassDefFoundError的:javax.sound.sampled.AudioSystem
这是一个古老的程序,我写了一年前,然后它的工作完美。为什么我得到这个例外,我该如何解决这个问题?
This is an old program that I wrote a year ago and then it worked perfectly.Why do I get this exception and how can I fix this?
推荐答案
AudioSystem
是JavaSound的一部分,JavaSound是桌面JVM / SDK的一部分。 JavaSound是不是present在Android JVM / SDK,让你的老code不会对任何当前的Android SDK编译。
AudioSystem
is part of JavaSound, and JavaSound is part of the desktop JVM/SDK. JavaSound is NOT present in the Android JVM/SDK, so your old code will not compile on any current Android SDK.
请参阅 http://developer.android.com/guide/topics/media /index.html 为Android音频功能概述:你将需要移植旧的code使用Android SDK类
See http://developer.android.com/guide/topics/media/index.html for the Android audio functionality outline: you will need to port your old code to use the Android SDK classes.
这篇关于我得到用java在Android(java.lang.NoClassDefFoundError的)一个例外,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!