Linux and Java sound - map mixers to devices

Hi,
I have a question regarding Java Sound API and Linux. I need to query a list of sound devices and let the user choose one of them for further audio operations. This works using the
AudioSystem.getMixerInfo()call. However, the names of the mixers are not very useful. I find the following mixers:
Intel [plughw:0,0], version 1.0.23
Intel [plughw:0,2], version 1.0.23Is there a way to get better names, similar to what Gnone or KDE sound panels display?
When I run the same code under Windows, the output is much better.

Try the code from the following article:
http://www.developerfusion.com/article/84314/wired-for-sound/

Similar Messages

  • Oracle Linux and Java 7u10

    Hi all,
    I installed Oracle Linux Server 6.3 selecting "software Development System" (java 1.6.0 comes with it).
    but I need to use Java 1.7
    So I downloaded jdk-7u10-linux-x64.rpm
    when I try to install it, I get the following error.
    Unpacking JAR files...
         rt.jar...
    Error: Could not open input file: /usr/java/jre1.7.0_10/lib/rt.pack
         jsse.jar...
    Error: Could not open input file: /usr/java/jre1.7.0_10/lib/jsse.pack
         charsets.jar...
    Error: Could not open input file: /usr/java/jre1.7.0_10/lib/charsets.pack
         localedata.jar...
    Error: Could not open input file: /usr/java/jre1.7.0_10/lib/ext/localedata.pack
    I can't uninstall java 1.6 because other rpm uses it.
    Can someone tell me what the "proper" way to install Oracle Linux and Java 1.7 should be?
    OR is there a Oracle Linux Server 6.4 coming out soon with Java 1.7 as its default package set ;-)
    thanks in advance,
    c.w.

    You can ignore the errors. The files named in the error lines do not exist in the rpm package, but are there as .jar files
    The following works under Oracle Linux 6.3 x86_64 (and probably other versions).
    1. Open the following URL in a web browser on your PC:
    <pre>
    http://www.oracle.com/technetwork/java/javase/downloads/index.html
    </pre>
    2. Click the JDK download button, accept the license agreement and download the JDE rpm package.
    3. Copy the following file to your Oracle Linux server (SFTP):
    <pre>
    jdk-7u10-linux-x64.rpm
    </pre>
    4. Login as root and use the YUM utility to install the RPM package.
    <pre>
    # yum install ./jdk-7u10-linux-x64.rpm
    </pre>
    5. Register the new installed java version, then change your default Java:
    <pre>
    # alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_10/bin/java 2
    # alternatives --config java
    </pre>
    Display your default Java version:
    <pre>
    # java -version
    java version "1.7.0_10"
    Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
    Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
    </pre>

  • Cannot recognise any sound devices in Linux using Java sound!

    Hi there - I'm new to Java sound, and can't even get my foot in the door on my Linux system. Even thought my speakers and microphone are fully functional on my system (I can record, playback, etc. using other programs) I cannot get Java to find the microphone, speaker, anything. I've tried calling "AudioSystem.isLineSupported(Port.Info.MICROPHONE)", which returns false, as with all the other Port.Info.... objects.
    I'm sure there are no programs using my audio devices (used lsof | grep snd and lsof | grep dsp, then killed the only program that had anything open) and I've tried running my Java program as the super-user too, but to no avail.
    One thing I CAN do is get sound from /dev/dsp - I can put this into a byte array and play it back later, but I don't know how to find out what sort of codec it uses, how to merge it with Java sound, or anything like that.
    Any help would be much appreciated!
    If it makes any difference, I'm using Xubuntu 8.10, and I normally don't use a microphone or flashy surround-sound speakers, so I've not touched the sound system since I installed Linux.

    Ports are tricky...and by tricky, I don't mean complicated so much as a pain.
    Try using Line.Info objects instead of Port.Info objects and see if you can get any lines.

  • Linux and the Sound Blaster Live

    Ive got my hands on a SB Li've 24bit external sound card and after some fiddling around I seem to only have standard stereo and no 5. Audio.
    My question is has anyone got these things to output 5. on Linux yet.
    I'm going to have to return it back to the distributor as I seem to be miss informed that it would work in Linux.
    Im getting this feeling that most Creative stuff is not "Linux friendly" and may not recommend their wares in future,
    Looks like its time to start a Linux Audio device company, 40 million users is a nice market.

    Hello,
    Please bear with me as I'm a complete novice on this.....
    I have the laptop, and whist re-decorating the room, I have?run?6 cables (sub woofer to be at the?rear of the room) to a wall mounted connector plate. So I think I need the following;
    . Software to convert the sound within my laptop to 5. format (if not already done) and to get it to a USB. Installed sound card should be capable of this.
    2. USB?cable from PC to ?The Sound Blaster? Li've!? 24-bit External?
    3. The Sound Blaster? Li've!? 24-bit External?
    4. Maybe someting else to amplify and distribute the audio
    5. 6 short leads to my wall mounted connector plate
    6. Speakers
    Not sure if the aboe helps?and perhaps there's another way of doing it instead of using the?Sound Blaster? Li've!? 24-bit External?
    Many thanks

  • I hear audio after leaving the pogo bingo luau room long after signing off from pogo. i have the latest flashplayer for fedora linux and java installed.

    as above

    Hi audiopaster, that sounds like a lingering sound from another window. Is Firefox completely closed when the audio continues as well?
    What I will do is look around and let you know what I see, as I try to reproduce this. However I may need your help to troubleshoot.
    Since this is a java game, all java applications running in the browser are allowed through the parameters in the Java Console [http://www.java.com/en/download/help/jcp_security.xml#control%20panel Finding Java Console]
    In the console look for the Java section and when you hear the audio continuing to place click View to see what is running. Aldo check the General > Java Cache Viewer, is there a temporary audio file there?
    Also what version of java is installed? I did not see any when I tested.
    It looks like pogo games do not support Linux [http://help.ea.com/en/article/supported-browsers-for-pogo/#2]
    So I looked on stack overflow and found [http://stackoverflow.com/questions/6259077/playing-game-music-in-java-how-to-stop-the-stream-of-data] that certain Audio implementations of java will not terminate on exit is because there may not be a call to stop audio.
    This makes me wonder if there is a cookie or session that is still going after you navigate away, this sounds really silly though. Please try to clear your cache if this continues. I will ask on irc with more info as well.

  • Toplink JPA and Java type mapping

    Hi there,
    I'm struggling wit mapping an existing database using Toplink Essentials.
    Specifically: I have an INT SQL field which I want to map as boolean/Boolean in my entity class.
    How to do this? Either in standard JPA or with some Toplink extensions?
    Markus

    Hi Markus,
    The JPA spec doesn't cover conversion/transformation but you can do it with TopLink Essentials using a Converter. I have an example pasted below that uses a converter to map between a database VARCHAR value and a pre-Java 5 enum (i.e., a hand coded enum-type class that runs in Java 1.4).
    I use a descriptor customizer to get hold of the Basic mapping (in TopLink a "DirectToFieldMapping") and then plug in a converter.
    --Shaun
    Persistence.xml:
    <property
       name="toplink.descriptor.customizer.TypeWriter"
       value="oracle.toplink.essentials.emf.examples.library.orm.TypeWriterCustomizer"/>The customizer:
    public class TypeWriterCustomizer implements DescriptorCustomizer {
          * Add customizer to translate between Enum and value.
         public void customize(ClassDescriptor descriptor) throws Exception {
              DirectToFieldMapping typeMapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("type");
              Converter typeWriterEnumConverter = TypeWriterEnumConverter.getInstance();
              typeMapping.setConverter(typeWriterEnumConverter);
    }The actual converter class:
    * TypeWriterEnumConverter is a singleton since it has no state.
    public class TypeWriterEnumConverter implements Converter {
         protected static TypeWriterEnumConverter instance = new TypeWriterEnumConverter();
         private TypeWriterEnumConverter() {}
         public static TypeWriterEnumConverter getInstance() {
              return instance;
         public Object convertDataValueToObjectValue(Object data, Session session) {
              String typeName = (String)data;
              return TWriterType.get(typeName);
         public Object convertObjectValueToDataValue(Object object, Session session) {
              TWriterType type = (TWriterType) object;
              if (type != null) {
                   return type.getName();
              } else {
                   return null;
         public void initialize(DatabaseMapping arg0, Session arg1) {}
         public boolean isMutable() {
              return false;
    }

  • Taking advantage of the fast linux OS - linux and java

    Hello Java Experts;
    I read a very interesting article in the news this week about the linux advantage.
    A german bank had 32 unix servers. Each at a cost of $50,000 dollars.Together these servers took 17 hours to crunch a calculation.
    That bank replaced those 32 unix servers with 40 linux servers at a cost of $3,000 dollars per server. The calculations were done in 11 minutes instead. They were therefore able to move around 10s of millions of dollars that much faster as a result. - basically it allowed them to take 10s of millions of dollars out of reserves that much faster.
    Now , does anyone know that story ?
    And does anyone know how the linux server cost that much ?
    I'm under the impression it is simply because a less expensive piece of hard ware was required -- does anyone know what that hardware was? I believe SUn boxes were running unix previously.
    I hear these kinds of stories all time time. I heard that a mainframe running linux is as fast as 10 mainframes. and ibm uses that advantage to sell to clients.
    Anyhow -- does anyone have a similar story about running java code on linux as opposed to unix ? or is this type of performance boost limited to certain types of applications.
    stephen

         This likely has nothing to do with the Linux operating system being any faster than the Unix operating system. I actually read the same article in the paper, and it simply means that by migrating to a free OS that runs on standard PCs, they saw a great performance benefit at a minimal price. I think this is simply attributed to their installing Linux on brand new 2ghz PCs, and their old Unix systems likely being confined to a Sun Solaris box, or another proprietary computer systems. PCs have grown by leaps and bounds, and likely their servers were quite old and had much less processing power than the standard desktop PCs linux allowed them to port to. I personally use RedHat linux 7.3 as my operating system of choice, however it's not because it has any speed benefits over windows.
    -Jason Thomas.

  • XMl and Java object mapping

    I need to map java objects with XMl Node or XML Elements.
    My java objets get some attributes, for instance name,color ...
    and i need an output like:
    <OBJECT_OF_TYPE_XXX>
    <NAME>scott</NAME>
    <COLOR>red</COLOR>
    </OBJECT_OF_TYPE_XXX>
    Any idea?
    Thanks
    Maurice

    You can try JAXB which includes a compiler that generates classes based on the XML Schema for your xml structure. It also features the possibility to convert between xml and the generated objects.
    Take a look at chapter 9 and 10 at http://java.sun.com/webservices/docs/1.1/tutorial/doc/index.html

  • Linux and Java are 64 bit. The native library is 32 bit. Any workaround?

    Folks,
    I am trying to run some java cipher/decipher programs that rely on native code (code which connects through the network to an HSM box).
    The issue is that theboth Linux kernel and JVM are 64 bit. But the native library seems to be 32 bit. I get the following message when trying to run the sample:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: jcryptoki (/opt/Eracom/lib/libjcryptoki.so: wrong ELF class: ELFCLASS32)
    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:981)
    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:950)
    at java.lang.System.loadLibrary(System.java:453)
    at jprov.cryptoki.Cryptoki.<clinit>(Cryptoki.java:38)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
    at au.com.eracom.crypto.provider.ERACOMProvider.<clinit>(ERACOMProvider.java:329)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
    at SHA512Generator.main(SHA512Generator.java:10)Is there any workaround or should I contact my HSM vendor and ask for a 64 bit version of this native library?

    Is there any workaround or should I contact my HSM vendor and ask for a 64 bit version of this native library?That would certainly be the best step so it should certainly be the first one.

  • Java Applets and Java Sound

    I have an applet that displays buttons on panel and after doing all this it has to play a sound file. I have made sure that only after the methods that display the buttons (like creating panel, adding buttons to that panel etc.) i am calling the method that plays the sound file. But what happens is that immediately it starts playing the sound file and after playing the sound file it displays the buttons etc. on the applet. Can you please help me with this problem??

    as has already been said you should:
    1) load the clips you want to play in the init() method (ie audioClip = Applet.newAudioClip(URL) )
    2) play them in the applet start() method
    3) stop the clip in the applet stop() method
    You shouldn't play the clip in the init() method because it's the method called by the applet to initialize itself.
    ie to paint itself...

  • Important - Linux and Java

    Hi!
    I'm trying to install j2sdk1.4.0_03-linux-i536 on
    Conectiva Linux 7.0. I've already download it a
    number of times but the archive seems to be corrupted.
    Anyone can give me some help!?
    Thanks a lot,
    Katia.

    Hi!
    I tried to install in both ways: RPM in self-extracting file and the Linux self-extracting file.
    I tried to install and get a message "corrupted file".
    On the third tentative I download them and then saves it in a CD. When I tried to copy the files from the CD for the HD, it copies just a part of the archive and reports a IO error.
    I don't know what to do.
    Thanks a lot.
    Katia.

  • Not able to recognize any video/audio devices using jmf and java soun

    Hi ,
    I need one help from your side.
    Here I am expecting some clarifications from you. Before that let you my environement.
    My working environment :
    Eclipse tool and added jmf jar to my project I did not do any thing more.
    If any thing I need to do just let me know. My target platform is MAC & UBUNTU.
    Please bare with my questions.
    1) I am not able to recognize any video/audio devices using jmf and java sound APIs on My system.
    ( I checked with the app mentioned in the http://www.java-forums.org/new-java/11201-jmf-cannot-connect-device.html )
    Do we need any administrives rights for our working PC.
    What is the procedure/ setup I need to follow from a java application to enable particular audio/video device since I dont about end-user system setup right.
    If possible send some sample code to recognize /r detect audio device ( voice input ). It should run on both MAC and UBUNTU.
    2) I run the one sample audio recording application of this link (http://www.jsresources.org/examples/SimpleAudioRecorder.java.html) which is provided by YOU.
    I got output audio file and able to hear voice on UBUNTU system but not able to hear voice on MAC system.
    I heared that default line in ( audio setup of the sys) is wont take any voice data on MAC.Why I made this stmt means we are getting false when using isSupported methods of JAVA SOUND API.
    ( like for TragetdataLine ...i,e, all ports are getting false)
    I have one sample audio recording app implemented by QUICKTIME API. In this case also he taking audio ftom device only using quicetime API.
    With that we are able to record and hear audio ( voice input --> not line in , external device we added some thing like SSB...)
    3) In case of Video capturing DataSource, Streams are implemented by PullBufferDataSource , PullBufferStream intefaces used.
    In case of Audio capturing DataSource, Streams are implemented by PushBufferDataSource, PushBufferStream intefaces used.
    Can you explain the reasons ? I gone through API but i am not clear.
    HOPE I WILL BE CLARIFIED EVERY THING FROM YOU.
    Thanks
    RamaRao.G

    Hi ,
    I need one help from your side.
    Here I am expecting some clarifications from you. Before that let you my environement.
    My working environment :
    Eclipse tool and added jmf jar to my project I did not do any thing more.
    If any thing I need to do just let me know. My target platform is MAC & UBUNTU.
    Please bare with my questions.
    1) I am not able to recognize any video/audio devices using jmf and java sound APIs on My system.
    ( I checked with the app mentioned in the http://www.java-forums.org/new-java/11201-jmf-cannot-connect-device.html )
    Do we need any administrives rights for our working PC.
    What is the procedure/ setup I need to follow from a java application to enable particular audio/video device since I dont about end-user system setup right.
    If possible send some sample code to recognize /r detect audio device ( voice input ). It should run on both MAC and UBUNTU.
    2) I run the one sample audio recording application of this link (http://www.jsresources.org/examples/SimpleAudioRecorder.java.html) which is provided by YOU.
    I got output audio file and able to hear voice on UBUNTU system but not able to hear voice on MAC system.
    I heared that default line in ( audio setup of the sys) is wont take any voice data on MAC.Why I made this stmt means we are getting false when using isSupported methods of JAVA SOUND API.
    ( like for TragetdataLine ...i,e, all ports are getting false)
    I have one sample audio recording app implemented by QUICKTIME API. In this case also he taking audio ftom device only using quicetime API.
    With that we are able to record and hear audio ( voice input --> not line in , external device we added some thing like SSB...)
    3) In case of Video capturing DataSource, Streams are implemented by PullBufferDataSource , PullBufferStream intefaces used.
    In case of Audio capturing DataSource, Streams are implemented by PushBufferDataSource, PushBufferStream intefaces used.
    Can you explain the reasons ? I gone through API but i am not clear.
    HOPE I WILL BE CLARIFIED EVERY THING FROM YOU.
    Thanks
    RamaRao.G

  • Java-wsdl-mapping file with incorrect case

    Hi. We're working with JDeveloper 10.1.3.1 preview and have encountered what I believe to be a bug. We have a schema with element names that are mixed case (such as FirstName). We are trying to use JAXB to create our classes and then wrap it as a web service. The problem is, the WSDL and java-wsdl-mapping file references the element names as firstName rather than FirstName.
    In experimenting, I've learned that if I create the WSDL and schema first and "Create Java Project from WSDL" that it creates a java-wsdl-mapping file with the case preserved. However the first time I go into the web services properties dialog and click OK, it re-creates these files with the case changed again.
    Please advise if this is expected behavior...although I don't see how it could be since it is inconsistent.
    Thanks very much,
    Richard Davis

    I was told the product manager and/or developers from Oracle watched this board. Doesn't anyone have a response to this?

  • OID/Linux and Netsacpe Java SDK don't play nice

    Here's a brief description of the problem. We are developing with the Netscape LDAP SDK for Java connecting to OID on Linux and deploying on Solaris. The problem I'm discussing here doesn't happen on Solaris. All access to the LDAP server is being funelled through one connection (please don't ask, I didn't design it).
    Lets call an add, modify, delete or read an "action," for the sake of convenience. When an ldapjdk.jar client connects to an OID server, it can perform 32764 "actions." On the 32765th, it blocks forever waiting for OID server to return. Ok, the obvious solution is to implement a timeout and try again. Did that and it doesn't work. Ok, lets try dropping the connection at a watermark (say 30000 actions) and establishing a new one. Nope, still doesn't work. At the 32765 actions per client machine mark, it blocks forever.
    Dumping the threads on the client side gives us something like the following:
    main:
    [1] java.lang.Object.wait (native method)
    [2] java.lang.Object.wait (Object.java:424)
    [3] netscape.ldap.LDAPMessageQueue.waitForMessage (LDAPMessageQueue.java:179)
    [4] netscape.ldap.LDAPMessageQueue.nextMessage (LDAPMessageQueue.java:101)
    [5] netscape.ldap.LDAPSearchListener.nextMessage (LDAPSearchListener.java:86)
    [6] netscape.ldap.LDAPConnection.search (LDAPConnection.java:2584)
    [7] netscape.ldap.LDAPConnection.read (LDAPConnection.java:2104)
    [8] netscape.ldap.LDAPConnection.read (LDAPConnection.java:2098)
    [9] ReadLockTest.run_test (ReadLockTest.java:96)
    [10] ReadLockTest.run (ReadLockTest.java:49)
    [11] ReadLockTest.main (ReadLockTest.java:25)
    LDAPConnThread chakotay:389:
    [1] java.net.SocketInputStream.socketRead (native method)
    [2] java.net.SocketInputStream.read (SocketInputStream.java:90)
    [3] java.io.BufferedInputStream.fill (BufferedInputStream.java:190)
    [4] java.io.BufferedInputStream.read (BufferedInputStream.java:208)
    [5] netscape.ldap.ber.stream.BERElement.getElement (BERElement.java:101)
    [6] netscape.ldap.LDAPConnThread.run (LDAPConnThread.java:420)
    Not much help there. I turned on all debugging on the OID server and got massive amounts of data back (and the server slowed to a crawl. :-] ). They all show the choke happening after gsldfb_FetchBaseObjs, and before leaving gslfcfdRefreshRootDSE. The last request (the 32765th) has started, but
    never completes. I can provide parts of the logs on request.
    Has anyone else encountered this problem?
    Thanks.
    Glenn McAllister
    SOMA Networks, Inc.

    Hello Glen:
    I have not seen this before. Sounds like you have done a thorough job troubleshooting this and this may be a bug. If you are able, I would like you to file a trouble report at our Oracle Support web site:
    http://www.oracle.com/support/metalink/index.html
    Thanks,
    Jay
    null

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

Maybe you are looking for