-1

我正在使用 JSR 135 播放音频文件。这就是我的做法。

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;

但我需要音频始终通过手机的扬声器播放。此时,如果我插入耳机,声音只会在听筒中播放。有没有办法做到这一点?

4

1 回答 1

0

不,没有办法做到这一点,海事组织也是如此。

于 2012-06-19T14:08:56.060 回答