No line matching interface TargetDataLine

  • Anonymous - 2011-03-18


    Could tell me why this exception?

    Exception in thread "Thread-19" java.lang.IllegalArgumentException: No line matching interface TargetDataLine supporting format PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian is supported.

            at javax.sound.sampled.AudioSystem.getLine(

    Best Regards


  • yohannmartineau

    yohannmartineau - 2011-03-20

    hi javier,

    actually, all combination of sample frequency, sample size etc are not supported by sound cards. I used those values because they seemed to be working on most sound cards I tested, but they may not work on all sound cards; Try with other values (big endian, 8 bits sample size, PCM_UNSIGNED), etc. Are you working on Mac OS ? I possibly got issues with sound cards on Mac OS JVM.



  • Anonymous - 2011-03-21


    I used Fedora 14 64bits but i am change to Ubuntu 64bits. because I'm having problems with sound and other things

    in Windows works well?, have not tried it yet.



  • yohannmartineau

    yohannmartineau - 2011-03-21

    I tested on windows 7 and windows xp and it worked, but it may depend on the sound card you're using. In theory, it should work with your pc, but unfortunately, in java, nothing guarantees a combination of sample frequency, sample size, endianness, sign, and  number of channels that will work on all computers.

  • Anonymous - 2011-04-11


    I tested en Ubuntu 10.10 Maverick and Fedora 14 and it worked (only that in Fedora i haven't install correctly the soundcard drivers).


  • yohannmartineau

    yohannmartineau - 2011-04-11

    great! good to know that it works.

  • Anonymous - 2012-07-31

    Please give your idea abt . I do not have an souncard installed . I got the same exception. Will I be able to recover this???

  • yohannmartineau

    yohannmartineau - 2012-07-31

    when you say you have no sound card, you mean it's integrated in your computer mother board? You can't use peers if you have no speakers nor microphone. As soon as you have a microphone plugged in your computer, it implies that you have a sound card, or the same features integrated on motherboard. I think you have sound features in your computer, but your sound card does not support this format. In this case it would be necessary to test several combinations, find one that works, and convert this format output to a standard one (used by default).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks