-1

I'm using JSR 135 to play an audio file. This is the way I'm doing it.

InputStream is = getClass().getResourceAsStream("/tone.mp3");
Player p = Manager.createPlayer(is, "audio/mp3");             
p.start();

// get volume control for player and set volume to max
VolumeControl vc = (VolumeControl) p.getControl("VolumeControl");
if (vc != null) {
    vc.setLevel(100);
}
p.close();
p = null;
is.close();
is = null;

But I need the audio to always play through the loudspeaker of the phone. In this moment, if I plugin a headset, the sound will only play in the earpiece. Is there a way to achieve this?

gnat
  • 6,213
  • 108
  • 53
  • 73
pabrou
  • 1

1 Answers1

0

No, there is no way to achieve this, and rightly so IMO.

funkybro
  • 8,432
  • 6
  • 39
  • 52