I want to play sound loud through the speaker on the phone - just like when the phone is in speaker phone mode. I try the following code, but can not get it to work :
player = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);
player.realize();
ToneControl tc = (ToneControl) player.getControl("ToneControl");
tc.setSequence(aSeq);
VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
vc.setLevel(100);
AudioPathControl apc = (AudioPathControl) player.getControl("AudioPathControl");
//apc is now null and of course, the below throws an exception
apc.setAudioPath(AudioPathControl.AUDIO_PATH_HANDS FREE);
player.start();
Why can I not get the AudioPathControl object? Does anyone know how to do this?