Unable to open the line: javax.sound.sampled.LineUnavailableException

J

Java Guy

I'm trying to hear the streaming audio from an IP web-cam using the Java
web interface provided by the camera.

Here's a Java console log that I think is indicating the problem:

-------------------
Unable to open the line: javax.sound.sampled.LineUnavailableException:
line with format PCM_SIGNED 8000.0 Hz, 16 bit,
mono, 2 bytes/frame, little-endian not supported.
------------------

When I access the camera using IE, and select the ActiveX interface, I
can hear the audio with no problem.

Installed JRE is 1.5.0_16.

This web-thread:

http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html

describes some sort of bi-directional audio application between 2
machines using java. One the respondents seems to
have the same problem:

----------------
bhavin said...

hi
i did run your voice chat program on diffrent pc
but reciver is having folling exception when i run Tx after running
sender
exception is as follow

javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not
supported.
--------------

The only suggestion was to test the microphone with AudioTest.java,
which was located here:

http://javaorigin.com/resource/AudioTest.java

Which seems like a dead link, but this might be an active link:

http://www.koders.com/java/fid1E7713C1086BEE7B66606B6F11E10C56C4EE71F1.aspx?s=md5

But I'm not sure if that would help, or even how to "run" it.

Any ideas how I should go about trying to fix this issue?
 
K

Knute Johnson

Java said:
I'm trying to hear the streaming audio from an IP web-cam using the Java
web interface provided by the camera.

Here's a Java console log that I think is indicating the problem:

-------------------
Unable to open the line: javax.sound.sampled.LineUnavailableException:
line with format PCM_SIGNED 8000.0 Hz, 16 bit,
mono, 2 bytes/frame, little-endian not supported.
------------------

When I access the camera using IE, and select the ActiveX interface, I
can hear the audio with no problem.

Installed JRE is 1.5.0_16.

This web-thread:

http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html

describes some sort of bi-directional audio application between 2
machines using java. One the respondents seems to
have the same problem:

----------------
bhavin said...

hi
i did run your voice chat program on diffrent pc
but reciver is having folling exception when i run Tx after running
sender
exception is as follow

javax.sound.sampled.LineUnavailableException: line with format
PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not
supported.
--------------

The only suggestion was to test the microphone with AudioTest.java,
which was located here:

http://javaorigin.com/resource/AudioTest.java

Which seems like a dead link, but this might be an active link:

http://www.koders.com/java/fid1E7713C1086BEE7B66606B6F11E10C56C4EE71F1.aspx?s=md5

But I'm not sure if that would help, or even how to "run" it.

Any ideas how I should go about trying to fix this issue?

Have you tried changing it to some other format? Like big endian or
unsigned?
 
J

Java Guy

Have you tried changing it to some other format? Like big endian or
unsigned?

How do I do that?

I'm using firefox to access the audio and video feed from an IP camera
(Trendnet TV-IP201):

http://www.trendnet.com/products/proddetail.asp?prod=135_TV-IP201&cat=150

When I use Internet Explorer, I can choose between ActiveX and Java.

When I use Firefox, I must use Java button to watch the live camera
feed.

But when using Firefox and Java, the audio stream doesn't work. I found
the above message in a log file.

I can't control the java code (it's in the camera).

Is there any changes I can make to the JRE settings?
 
K

Knute Johnson

Java said:
How do I do that?

I'm using firefox to access the audio and video feed from an IP camera
(Trendnet TV-IP201):

http://www.trendnet.com/products/proddetail.asp?prod=135_TV-IP201&cat=150

When I use Internet Explorer, I can choose between ActiveX and Java.

When I use Firefox, I must use Java button to watch the live camera
feed.

But when using Firefox and Java, the audio stream doesn't work. I found
the above message in a log file.

I can't control the java code (it's in the camera).

Is there any changes I can make to the JRE settings?

I didn't understand that you weren't writing the code. I think you are
out of luck unless you can modify the source code. The problem is most
likely caused by your sound card not accepting audio data in that
format. If you have another sound card, try that.
 
R

Roedy Green

-------------------
Unable to open the line: javax.sound.sampled.LineUnavailableException:
line with format PCM_SIGNED 8000.0 Hz, 16 bit,
mono, 2 bytes/frame, little-endian not supported.
------------------

You want first to create a list of what formats ARE supported. Many
formats you might expect will be are not.

see http://mindprod.com/jgloss/sound.html
for how to get a list.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Learning is not compulsory... neither is survival."
~ Dr. W. (William) Edwards Deming (born: 1900-10-14 died: 1993-12-20 at age: 93))
 
R

Roedy Green

Is there any changes I can make to the JRE settings?

you might find a third party sound library that has the support you
need.

I wrote some code to find out what is supported, but it does not tell
you much. I am looking for a technique to get more detail.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Learning is not compulsory... neither is survival."
~ Dr. W. (William) Edwards Deming (born: 1900-10-14 died: 1993-12-20 at age: 93))
 
J

Java Guy

Roedy said:
see http://amug.org/~glguerin/other/index.html
AboutSound to find out what your machine supports.

I downloaded and unzipped this:

AboutSound: Describing JavaSound (aboutsound.zip).

There were 2 files

aboutsound.java
aboutsound.jar

My system doesn't know what to do with a .java file.

When I try to open (run) the .jar file, I get this:

Java Virtual Machine Launcher
- Invalid or corrupt jarfile (aboutsound.jar)

I then opened a command prompt and entered this:

java aboutsound.java

java aboutsound.jar

In both cases, I got

"Exception in thread "main" java.lang.noclassdeffounderror" yada yada
yada

What am I supposed to do with those files?

The other file (soundmonitor.zip) contains sndmon.jar and a readme
file. The readme file says to double-click on "sndmon.jar". When I do
that, a small app starts running (JavaSound Input Levels) showing 2
slider controls. The controls are unresponsive (I can't move them).

When I open my own speaker control (mixer control panel) and move the
sliders around, the sliders in the java app are unresponsive and do
nothing.
 
L

Lew

Java said:
I downloaded and unzipped this:

AboutSound: Describing JavaSound (aboutsound.zip).

There were 2 files

aboutsound.java
aboutsound.jar

My system doesn't know what to do with a .java file.

Then tell it.
 
R

Roedy Green

boutSound: Describing JavaSound (aboutsound.zip).

If you have java.exe installed, see
http://mindprod.com/jgloss/javaexe.html

for how to make it run your jar.

You are on the edge of writing Java programs yourself. See
http://mindprod.com/jgloss/gettingstarted.html
for what to do.

Most of us are running a desktop machine of some kind. It gets more
complicated if you have smaller devices.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Learning is not compulsory... neither is survival."
~ Dr. W. (William) Edwards Deming (born: 1900-10-14 died: 1993-12-20 at age: 93))
 
J

Java Guy

Lew said:
That depends. Do you want to compile the file?

The audio stream from an IP camera does not play when I select it's Java
option.

It does play (on IE) when I select it's ActiveX option.

If messing around with aboutsound.java or aboutsound.jar will help me
correct that situation, then how do I tell my system to "run" those two
files? I don't want to install a compiler if I don't have to.

I believe the following log entry is an important clue as to why the
java method is not working:

-------------------
Unable to open the line: javax.sound.sampled.LineUnavailableException:
line with format PCM_SIGNED 8000.0 Hz, 16 bit,
mono, 2 bytes/frame, little-endian not supported.
------------------

Is there really anything I can do to correct this situation even - if
aboutsound tells me something useful?

Note: I am running win-98, and JRE 1.5 update 16. I haven't tried to
access the audio stream from this camera from a system running XP. Is
this aspect of Java independent of OS, or could there be a difference
between 98 and XP in this regard?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top