But I got a Invalid Device Error. The question is whether the parameters for the mehtod alcCaptureOpenDevice are correct. There is no way to define a device in this method. In the OpenAL 1.1 Spec parameters looks like this:

According to the OpenAL 1.1 programmers guide, the byte[] or ByteBuffer is actually a device name String. (it's normally ALCchar*, but char* gets converted to byte[] and ByteBuffer). I think you'll have to get the device name, convert it to the character bytes, but be sure that you convert to 8-bit characters, not the default 16-bit unicode characters of Java (there are methods in the Java API to do this).

The bytes in the ByteBuffer, are they representing 16-bit character strings (can check by looking at every alternating byte and seeing if it's 0x00)? Since the OpenAL function requires an ALCchar (8-bit characters), you'll need to do some conversion. Unfortunately, I don't have an IDE set up where I am right now, but my guess is you'll have to do something like this:

[EDIT]: Looking at the public API of JOAL, there's also an ALC.alcgetStringImpl() which returns a ByteBuffer. Maybe that retains the 8-bit characters for you, which you can feed into alcCaptureOpenDevice(ByteBuffer, ...) ?

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org