Hi,
so far i know to read audio we need targetdataline. but if i need to read from microphone port what should i do?
My code is

line = (TargetDataLine) AudioSystem.getLine((Line.Info)Port.Info.MICROPHON E);

which shows an exception "ClassCastException". What to do?