【问题标题】:Trouble with loud speaker off on Galaxy SGalaxy S上的扬声器关闭问题
【发布时间】:2010-11-25 15:10:48
【问题描述】:

有没有其他人在三星 Galaxy S 上遇到过这种情况?

当我使用以下方法打开扬声器时,它工作正常:

audioManager.setSpeakerphoneOn(true);

但是当我尝试相反的方式将其关闭时:

audioManager.setSpeakerphoneOn(false);

扬声器保持打开状态,并通过它而不是设备上的耳机播放音频。

以上适用于 Nexus One 和 HTC Hero,前几天刚拿到三星 Galaxy,但它不起作用,有没有其他人遇到过这个问题,也许知道它为什么会发生以及是否有解决方法?

【问题讨论】:

  • 是的,我也看到了,但没有找到解决方案。

标签: android audio android-sdk-2.1 speakerphone


【解决方案1】:

这是我必须做的才能让它工作:

if (isGalaxyS()) {
    audioManager.setMode(AudioManager.MODE_IN_CALL);
    audioManager.setMode(AudioManager.MODE_NORMAL);
    audioManager.setSpeakerphoneOn(flag);
}

似乎这来回以某种方式重置了音频通道。为了完整起见,这里是 isGalaxyS()(请注意,我只在 Epic 上测试过这个!):

public static boolean isGalaxyS() {
    String model = Build.MODEL;
    return  model.equalsIgnoreCase("GT-I9000") ||       // base model
            model.equalsIgnoreCase("SPH-D700") ||       // Epic         (Sprint)
            model.equalsIgnoreCase("SGH-I897") ||       // Captivate    (AT&T)
            model.equalsIgnoreCase("SGH-T959") ||       // Vibrant      (T-Mobile)
            model.equalsIgnoreCase("SCH-I500") ||       // Fascinate    (Verizon)
            model.equalsIgnoreCase("SCH-I400");         // Continuum    (T-Mobile) 
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多