Java的碳成分的预警运行 - OS X [英] Java Carbon Component warning on runtime - OS X

查看:158
本文介绍了Java的碳成分的预警运行 - OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近学会了如何添加声音到一个小蛇游戏我创造。当蛇吃苹果的声音播放。我的问题是每一个蛇吃一个苹果,我得到了这个cosole预警时间(但程序继续运行):


  

015-10-13 10:00:16.922的java [39731:970632] 10:00:16.922警告:140:本申请,或它使用的库,使用德precated碳组件管理托管音频单元。这种支持将在未来的版本中删除。此外,这使得在主机与版本3音频单元不兼容。在 AudioComponent.h 请过渡到API的。


这是什么意思,什么会我需要做来解决这个问题?

下面是我的方式以播放声音:

 私有静态无效playSound(文件声音){    尝试{
        夹夹= AudioSystem.getClip();
        clip.open(AudioSystem.getAudioInputStream(音));
        clip.start();        视频下载(clip.getMicrosecondLength()/ 1000);    }赶上(例外五){    }}


解决方案

TL; DR:

这是用于掌管你的声音处理程序,在这种情况下看起来像 AudioSystem 的开发者控制台的警告。你的程序应该工作,但它会继续抛出这些警告。您是否使用Java的一个旧版本?这或许可以解释这个问题。

长篇

我碰到这个问题就来了,因为我得到了同样的警告(使用不同的时间和过程标记)在Python与SimpleCV工作。我做了一个小挖,我想我至少可以阐述的问题,如果不解决这个问题。

首先,这是一个Apple特定的问题。我们所看到的警告实际上是一个控制台日志记,你可以看到,如果你打开​​你的控制台并查找时间戳。碳成分Manager是Mac电脑处理声音去precated方式,并正在逐步淘汰对使用 AudioComponent.h 更新的方式。
它看起来像 AudioSystem 仍在继续其业务的较旧的方式。这说明是一个信号,即他们需要更新 AudioSystem 通过新的API接口开发者。这有可能这已经在新的Java版本解决。你的程序应该正常工作,如果你忽略它,但你可以尝试使用较新的Java版本,看看是否有帮助。

我建议你编辑的问题,包括您的系统规格和Java版本。

碳睿德precation更多信息:

https://developer.apple.com/library/mac/releasenotes/General/CarbonCoreDe$p$pcations/

万一别人运行到这个从SimpleCV / Python和完整性:

我在MacBook Pro上(2011年末)上运行OSX埃尔卡皮坦,使用Python 3.5和1.3 SimpleCV。我的控制台的警告(我猜)从相机时,()是用来拍照的SimpleCV时播放快门声音造成的。

I recently learnt how to add sound into a small snake game i am creating. The sound plays when the snake eats the apple. The problem i have is every time the snake eats an apple i get this warning in the cosole (but the program continues to run):

015-10-13 10:00:16.922 java[39731:970632] 10:00:16.922 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.

What does this mean, and what would i need to do to fix this error?

Here is my method to play the sound:

 private static void playSound(File Sound){

    try{
        Clip clip = AudioSystem.getClip();
        clip.open(AudioSystem.getAudioInputStream(Sound));
        clip.start();

        Thread.sleep(clip.getMicrosecondLength()/1000);

    }catch(Exception e){

    }

}

解决方案

TL;DR:

This is a console warning intended for the developers in charge of your sound handler, which in this case looks like AudioSystem. Your program should work, but it'll keep throwing these warnings. Are you using an older version of Java? That might explain the issue.

Longform:

I came across this question because I got the same warning (with a different time and process stamp) working with SimpleCV in Python. I did a little digging and I think I can at least elaborate on the issue, if not solve it.

First, this is an Apple-specific issue. The warning we're seeing is actually a console log note, which you can see if you open up your Console and look for the timestamp. The Carbon Component Manager is a deprecated way that Macs handles sound, and is being phased out for a newer way that uses AudioComponent.h. It looks like AudioSystem is still going about its business the older way. This note is a signal to the developers that they need to update AudioSystem to interface with the new API. It's possible this has already been resolved in newer Java versions. Your program should work fine if you just ignore it, but you could try using a newer Java version to see if that helps.

I'd recommend editing your question to include your system specs and Java version.

More info on Carbon Core Deprecation:

https://developer.apple.com/library/mac/releasenotes/General/CarbonCoreDeprecations/

In case anyone else runs into this from SimpleCV/Python, and for completeness:

I'm running OSX El Capitan on a Macbook Pro (Late 2011), using Python 3.5 and SimpleCV 1.3. My console warning (I'm guessing) stems from the shutter sound that is played when Camera() is used to take a picture in SimpleCV.

这篇关于Java的碳成分的预警运行 - OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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