PlayN mp3支持UnsupportedAudioFileException [英] PlayN mp3 support UnsupportedAudioFileException

查看:100
本文介绍了PlayN mp3支持UnsupportedAudioFileException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经进行了数天的研究,以找出解决问题的方法. PlayN JavaSound类使用javax.sound.sampled.AudioSystem类播放声音,并且似乎不支持mp3格式.

I've been researching for days to figure out how to resolve this with no luck. The PlayN JavaSound class uses the javax.sound.sampled.AudioSystem class to play sounds, and the mp3 format does not seem to be supported.

javax.sound.sampled.UnsupportedAudioFileException:无法获取音频 来自输入流的输入流 javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) 在playn.java.JavaSound.init(JavaSound.java:71) ......

javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input stream at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) at playn.java.JavaSound.init(JavaSound.java:71) ......

AudioSystem类上找不到很多有关在Java中播放mp3的信息,所以我陷入了困境.似乎有一种使用javafx.scene.media.MediaPlayer在Java 7中播放mp3的新方法,但是我想知道是否有人知道答案.

I cannot find a lot of information on playing mp3s in Java with the AudioSystem class, so I am stuck. It seems like there is a new way to play mp3s in Java 7 with javafx.scene.media.MediaPlayer, but I would like to know if anyone knows the answer to this.

推荐答案

我需要下载一个插件(我认为是这样的:

I needed to download a plugin (I think it was this one: http://www.oracle.com/technetwork/java/javase/download-137625.html ). I am not sure if this was the case because I did my setup without Maven.

这篇关于PlayN mp3支持UnsupportedAudioFileException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆