Sun,音频播放器和声音I / O. [英] Sun, Audio-player and Sound I/O

查看:140
本文介绍了Sun,音频播放器和声音I / O.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些与Sun,音频播放器和声音输入/输出相关的问题

I have a few questions related to Sun, Audio-player and Sound Input/Output

为什么 sun.audio.AudioPlayer package不是Java API的一部分?这里有一些信息: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6b14/sun/audio/AudioPlayer.java 但它仍然是我默认的JDK构建的一部分使用。

Why is the sun.audio.AudioPlayer package not part of the Java API? Some info is here instead: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6b14/sun/audio/AudioPlayer.java Yet it is still part of the default JDK build I am using.

我已经尝试过使用JMF,花了半天的时间用螺丝钉绕它,但没有真正有用。我设法将 jmf.jar 导入到Eclipse中我尝试了一个演示脚本,它仍然没有像业务那样吐出错误。考虑到它现在被抛弃了?!?但是,Java提供了一个相对较新版本的链接: http:// www .oracle.com / technetwork / java / javase / download-142937.html 我有点担心如何在页面底部写下false ,,,,,,,?

I have tried using JMF and spent half the day screw balling around with it, to no real avail. I managed to import the jmf.jar into Eclipse I tried a demo script and it still spat out errors like nobody business. Considering its abandoned now?!? Java does however provide a link for a relatively new version: http://www.oracle.com/technetwork/java/javase/download-142937.html I am a little concerned however how at the bottom of the page the following is written "false,,,,,,,"?

您认为什么是用于音频I / O和操作的最佳软件包?

Whats the best package to use for audio I/O and manipulation in your opinion?

我只是想工作在一个项目和我虽然MP3播放器将是一个很好的起点,因为我可以做一点摆动。然而它似乎相当困难,因为从我所看到的Java并不是非常热衷于制作mp3和音频操作包。

I just want to work on a project and I though an MP3 player would be a nice place to start as I can do a little swing. However it seems to be rather difficult as from what I have read Java is not really very keen on making mp3 and audio manipulation packages.

推荐答案

< h2> sun.audio未记录

与其他 sun。* 包一样,它没有记录,可能会消失。

sun.audio is undocumented

Like other sun.* packages, it is undocumented and it might disappear.

这是一个可选包,不是SE的一部分,也没有在很长一段时间内更新。 Oracle上有一个页面,它仍然可用,但是,谁知道会发生什么。

It's an optional package, not part of the SE and hasn't been updated in a long time. Oracle has a page on it and it's still available but, well, who knows what will happen to it.

这是当前的Java声音实现,它是SE的一部分,可以找到它的教程这里。如果你想在Java中使用音频这是你应该学习的东西,因为它是官方的,它可以工作,它有时会更新并且有很好的文档记录。

This is the current Java sound implementation, it is part of the SE and the tutorial for it can be found here. If you want to use audio in Java this is what you should learn because it's official, it works, it gets updated sometimes and it is well-documented.

为什么会这样?尽管在文件系统中无处不在,但mp3有许可和专利问题的历史。 Mp3是一个雷区,这可能是Sun / Oracle没有努力支持它的原因。 (如果这就是原因,我不会责怪他们。)

Why is that? Despite being ubiquitous in file systems, mp3 has a history of licensing and patent issues. Mp3 is a minefield and this may be why Sun/Oracle has not put effort in to supporting it. (If this is why, I don't blame them.)

如果你真的想玩mp3,那么网上就会出现一些第三方解码器。推荐一个没有意义,因为所有这些都会读取mp3。

If you really want to play mp3 there are some third-party decoders floating around on the web. There is no point in recommending one because all of them will read mp3.

使用 javafx.scene.media.MediaPlayer 。请参阅 javafx .scene.media /支持的媒体类型。 JavaFX是Java 8(以及Java 7的新版本)中JRE / JDK的一部分,并且(可能)最终将取代几个SE API,如 javax.sound javax.swing

Use a javafx.scene.media.MediaPlayer. See javafx.scene.media/Supported Media Types. JavaFX is part of the JRE/JDK as of Java 8 (and new versions of Java 7) and will (probably) eventually supersede several SE APIs like javax.sound and javax.swing.

这篇关于Sun,音频播放器和声音I / O.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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