Skip to content

Iris_0.2.0 still has recording line error with new openBrowser #5

Open
JordanMajd opened this Issue Dec 14, 2011 · 6 comments

4 participants

@JordanMajd

After downloading and building Iris_0.2.0 source when I run it with java -jar Iris_0.1.0* I get the following error:

C:\Iris\build\jar>java -jar Iris_0.1.0.jar
IRIS VOICE AUTOMATION - Created by Samir Ahmed 2011
 Please visit http://www.samir-ahmed.com/ for more information
 To report issues please go to https://www.github.com/samirahmed

unable to get a recording line
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 1
6000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.

        at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(Unknown Source)
        at com.sun.media.sound.AbstractDataLine.open(Unknown Source)
        at com.sun.media.sound.AbstractDataLine.open(Unknown Source)
        at com.samir_ahmed.Iris.Recorder.<init>(Unknown Source)
        at com.samir_ahmed.Iris.Recognizer.<init>(Unknown Source)
        at com.samir_ahmed.Iris.Iris.<init>(Unknown Source)
        at com.samir_ahmed.Iris.Iris.main(Unknown Source)

I compiled and ran it using the 64-bit 1.7.0_2 JDK on a Win7 64 bit OS

*I forked the build.xml file and submitted the changes so that ant will build the proper version name.

@samirahmed
Owner

Looking at the stack trace and error report, it seems like your sound card doesn't support the audio format listed there.

Unfortunately, some of those requirements (16bit/16Khz/4byte frames) are required by Google's Voice to Text API.

after some googling i determined that there is a way to determine what your sound card can support

taken from

http://amug.org/~glguerin/other/index.html ... AboutSound

you can compile and run the AboutSound.java file

it shoots out a response regarding what your audio card can support.

thats as much as I know about the topic, if you can figure out a way to record in a more standard way and covert it to the current format, I presume that could be a solution too

@JordanMajd

Thanks, I'll look into this and get back to you.

@inmaAsesores

I am having the same issue. I get

unable to get a recording line
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 1
6000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.

But is it really because of the sound card? Could it be because of some other reason?

I got the supported formats using AboutSound and, for example, I got this:
...
PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
...

I didn't got any value for sample rate.

@JordanMajd

PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian

It would seem that your card does support 'little-endian', perhaps you need to change some of your audio settings in order to run the program first.

@inmaAsesores

Thanks a lot for your answer. What settings do you mean? Can you help me with this?

@Rai220
Rai220 commented Aug 9, 2012

It crashes on this:

        primaryLine = (TargetDataLine) AudioSystem.getLine(info);
        primaryLine.open(audioFormat);
        secondaryLine = (TargetDataLine) AudioSystem.getLine(info2);
       secondaryLine.open(audioFormat);

I think there is some trouble to open two same sound lines in windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.