马克/ getAudioInputStream期间复位异常() [英] mark/reset exception during getAudioInputStream()

查看:573
本文介绍了马克/ getAudioInputStream期间复位异常()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我贴一个问题(如下所述)的修复,但一直没能证实它是否解决了问题。可能有人使用Java 7尝试了以下Applet与汇报?这将是非常美联社preciated。

I posted a fix of a problem (explained below) but haven't been able to confirm if it solves the problem. Could someone with Java 7 try the out the following Applet and report back? It would be MUCH appreciated.

AudioMixerDemo

这是向我报告的问题是,这需要一个声音片段的负载从震动资源按钮的最上面一行不工作。错误指向行,其中音频文件被读取并说一个标记/复位I / O异常被抛出。

The problem that was reported to me was that the top row of buttons which require the load of a sound clip from a jarred resource are not working. The error points to the line where the audio file is being read and says a "mark/reset" I/O exception is being thrown.

这code适用于Java 6的不工作的Java 7的违规声明如下:

This code works for Java 6 is not working for Java 7. The offending statement follows:

AudioInputStream ais = AudioSystem.getAudioInputStream(
    AudioMixer.class.getResourceAsStream(fileName));

该内部区域返回的InputStream ,我认为这是这里的可标记的问题就出现了。报告问题Oracle的bug数据库作为向后兼容的问题,但由于低优先级。

The inner area returns an InputStream, and I think that is where the "markability" issue arises. The issue was reported at Oracle's bug database as a backwards compatibility problem, but given a low priority.

我已经重新上述codeD如下:

I have recoded the above as follows:

URL url = AudioMixer.class.getResource(fileName);
AudioInputStream ais =  AudioSystem.getAudioInputStream(url); 

有什么的AudioSystem的API,提及此方法将抛出标记/复位I / O异常英寸所以,我希望。但我一直没能证实这一点!

There is nothing in the AudioSystem API that mentions that this method will throw "mark/reset" I/O exceptions. So, I am hopeful. But I haven't been able to confirm this!

推荐答案

谁报告的问题的Java 7的用户已经联系了我,并给予竖起大拇指。所以我presuming的向后兼容性问题的诊断和修复是否正确,并且不再正在寻求测试仪(除非你是在检查出AudioMixer只是有兴趣)。

The Java 7 user who reported the problem has contacted me and given a thumbs up. So I am presuming the diagnosis and fix of the backwards compatibility problem are correct, and no longer am seeking testers (unless you are just interested in checking out the AudioMixer).

这篇关于马克/ getAudioInputStream期间复位异常()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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