Galaxy S 上的扬声器关闭问题

发布于 2024-10-04 19:14:46 字数 362 浏览 0 评论 0原文

有其他人在 Samsung Galaxy S 上遇到过这种情况吗?

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

audioManager.setSpeakerphoneOn(true);

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

audioManager.setSpeakerphoneOn(false);

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

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

Has anyone else experienced this on the Samsung Galaxy S?

When I use the folowing to turn the Loudspeaker on it works fine:

audioManager.setSpeakerphoneOn(true);

But when I try the opposite to turn it off:

audioManager.setSpeakerphoneOn(false);

The Loudspeaker stays on and audio is played via that instead of the ear piece on the device.

The above works on the Nexus One and HTC Hero, just got a Samsung Galaxy the other day and it doesn't work, has anyone else encountered the issue and perhaps know why it is happening and if there is a work around?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花伊自在美 2024-10-11 19:14:46

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

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) 
}

Here's what I have to do to get it to work:

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

Seems that this back and forth somehow resets the audio channel. For completeness here's isGalaxyS() (note that I've only tested this on the 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) 
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文