JDK-7124211 : [macosx] AudioSystem.getLine throw Exception
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 7,8
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux,os_x,windows_vista
  • CPU: generic,x86
  • Submitted: 2011-12-23
  • Updated: 2016-04-21
  • Resolved: 2016-04-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorResolved
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
http://java.net/jira/browse/MACOSX_PORT-771 submitted 2011/12/09 by Alexander Petrov
Next code throw Exception:
AudioFormat format = new AudioFormat(22050, 8, 1, false, false);
TargetDataLine line = AudioSystem.getTargetDataLine(format);
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
TargetDataLine line = (TargetDataLine)AudioSystem.getLine(info);
java.lang.IllegalArgumentException: No line matching interface TargetDataLine supporting format PCM_UNSIGNED 22050.0 Hz, 8 bit, mono, 1 bytes/frame,  is 
at javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:476)
at bug6372428.testRecord(bug6372428.java:248)
at bug6372428.main(bug6372428.java:39)
On JDK 6 all OK.
Build: b220
Tests failed (Regression):
closed/javax/sound/sampled/DirectAudio/bug6372428.java

Comments
EVALUATION The test fails because the implementation supports only "current" sample rate for input audio devices (see cr 7124225) Anyway the test should be updated to ignore "unsupported format" exceptions. also cr 7109623 reports the test failures on windows & ubuntu
23-12-2011