我正在使用 ToneGenerator 来播放连续的哔声。问题是音量太小了!
当音量低于8时,我们什么都听不到。而最大音量时,它一点也不响亮......
这是DTMF 声音的限制还是我做错了什么?
这是代码:
private final int TONE_TYPE = ToneGenerator.TONE_DTMF_5;
private final int STREAM = AudioManager.STREAM_MUSIC;
private final int DOT_TIME = 3;
public SoundManager(Activity anActivity) {
audio = (AudioManager) anActivity
.getSystemService(Context.AUDIO_SERVICE);
generator = new ToneGenerator(STREAM,
audio.getStreamMaxVolume(STREAM));
}
private void playBeep() {
generator.startTone(TONE_TYPE, DOT_TIME);
}