Java Carbon Component Runtime Warning - OS X

I recently learned how to add sound to a small snake game that I create. A sound plays when a snake eats an apple. The problem is that every time the snake eats an apple, I get this warning in a shard (but the program continues to work):

015-10-13 10: 00: 16.922 java [39731: 970632] 10: 00: 16.922 WARNING: 140: This application or the library it uses uses an outdated carbon component manager to host audio devices. Support for this will be removed in a future release. In addition, this makes the host incompatible with version 3 audio blocks. Switch to the API in AudioComponent.h .

What does this mean and what do I need to do to fix this error?

Here is my method for playing 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){ } } 
+5
source share
1 answer

TL DR:

This is a console warning designed for developers responsible for your sound processor, which in this case looks like an AudioSystem . Your program should work, but it will continue to throw these warnings. Are you using an older version of Java? This may explain the problem.

full form:

I came across this question because I received the same warning (with a different time and process stamp) while working with SimpleCV in Python. I did a little work, and I think that at least I can dwell on this issue in detail if I do not solve it.

Firstly, this is Apple's problem. The warning we see is actually a note to the console log, which you can see by opening the console and finding the timestamp. The Carbon Component Manager is an outdated way that Mac processes sound, and phased out for a newer way using AudioComponent.h . It seems that AudioSystem is still running its business in the old way. This note is a signal to developers that they need to update the AudioSystem to interact with the new API. Perhaps this has already been allowed in newer versions of Java. Your program should work just fine if you just ignore it, but you can try using a newer version of Java to see if this helps.

I would recommend editing your question to include your system specifications and Java version.

Further information on carbon core obsolescence:

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

In case anyone else comes across this with SimpleCV / Python and for completeness:

I am running OSX El Capitan on a Macbook Pro (late 2011) using Python 3.5 and SimpleCV 1.3. A warning about my console (I guess) stems from the shutter sound that plays when Camera () is used to shoot in SimpleCV.

+4
source

Source: https://habr.com/ru/post/1233594/


All Articles