Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

getControl(...MUTE) throws exception

29c5fec5-d639-4e48-b3ff-9be9dfc1b335Feb 5 2015 — edited Feb 5 2015

Hello,

I want to control the volume of the line input of my audio card.

Here is my code:

////////////////////////////////////////

...

portMixer.open();

Port LineIn = (Port) portMixer.getLine(Port.Info.LINE_IN);

LineIn.open();

Control[] controls = LineIn.getControls();

for (i=0; i<controls.length; i++)

{

  System.out.println(controls[i].toString());

}

BooleanControl Mute = (BooleanControl) LineIn.getControl(BooleanControl.Type.MUTE);

////////////////////////////////////////

The output from the println command is:

"Hauptlautstärke Control containing Mute, and Volume Controls."

Therefore I assumed that "MUTE" or "VOLUME" should be possible for a .getControl(...) call.

But .getControl(BooleanControl.Type.MUTE) throws an exception: "Unsupported control type: Mute"

Does anybody know, why this happens?

Regards,

Uwe

P.S.:

FloatControl Vol = (FloatControl) LineIn.getControl(FloatControl.Type.VOLUME); throws the exception: "Unsupported control type: Volume"

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 5 2015
Added on Feb 5 2015
4 comments
1,572 views