0 Replies Latest reply: Nov 1, 2012 11:18 AM by 971964 RSS

    Record sound - AudioFormat Problem

    971964
      Hey there,

      i am trying to record just any sound which is send to the speaker.

      Therefore i tried to automatically choose an AudioFormat but the script i use could not find any matching one. This should be done by the getFormat method.


      This class prints out:

      INFO: 0

      No sound line found

      Line is not supported

      Exception in thread "Thread-3" java.lang.IllegalArgumentException: No line matching interface TargetDataLine is supported.

           at javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:476)

           at Lib.Audio.run(Audio.java:38)



      How can i fix this problem?

      [Here is my code|http://pastebin.com/qexshipw]


      UPDATE:
      I found out, that i can find some AudioFormats when i use an headset instead of the speakers.
      Anyway it is not jet fully working. The console prints out:
      INFO: 2
      8
      8
      Congrats, your line is supported
      Exception in thread "Thread-3" java.lang.IllegalArgumentException: invalid frame rate: NOT_SPECIFIED
           at com.sun.media.sound.Toolkit.isFullySpecifiedAudioFormat(Toolkit.java:160)
           at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:115)
           at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:156)
           at Lib.Audio.run(Audio.java:39)


      Thanks in advance, Andre

      Small Update