我在网上转转了一下,但没什么运气。有没有人知道有没有?
发布于 2012-04-17 10:17:38
显然答案是否定的。没能在外面找到任何东西。
发布于 2012-04-12 09:32:57
使用Quicktime API来做这样的事情,
我已经用这个quickTime.jar解决了我的问题
您可以从apple.com下载此实用程序。
发布于 2014-06-06 06:59:21
我知道您正在寻找一个.jar文件来提供对.wma文件的支持,但是这个解决方案就是我获得对.wma文件的支持的方式,它并不比放入一个新的jar复杂。从技术上讲,这不是SPI,但由于似乎没有这样的东西,我认为发布一个简单的替代方案可能是有用的。
从this answer我找到了我的方向。但是,在您深入研究JAVE并了解它的用途之前,我将提供一段代码,以便您可以了解我为转换和播放wma文件需要编写多少代码。JAVE所做的一切都需要使用Encoder类的一个实例。
try {
EncodingAttributes attr = new EncodingAttributes();
attr.setAudioAttributes(new AudioAttributes()); //default values
attr.setVideoAttributes(new VideoAttributes()); //default values
attr.setFormat("wav"); //this is the target format I am trying to achieve
//b.wma is a file I brought to the project
File wma = new File("Resources\\b.wma");
//target.wav is the created file I'll achieve after the encode, which gets used to make a Clip
File target = new File("Resources\\target.wav");
Encoder encoder = new Encoder();
//this will show you all supported encoding / decoding formats
//String[] list = encoder.getSupportedEncodingFormats();
//String[] list = encoder.getSupportedDecodingFormats()
encoder.encode(wma, target, attr);
AudioInputStream is = AudioSystem.getAudioInputStream(target);
Clip clip = AudioSystem.getClip();
clip.open(is);
clip.setFramePosition(0);
clip.start();
} catch (IllegalArgumentException | EncoderException e) {
e.printStackTrace();
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (LineUnavailableException e) {
e.printStackTrace();
}https://stackoverflow.com/questions/10115977
复制相似问题