【问题标题】:What are the different (int routes) values for setAudioRoute (int routes)?setAudioRoute (int routes) 有哪些不同的 (int routes) 值?
【发布时间】:2019-11-21 02:02:13
【问题描述】:

在哪里可以找到可用于以下功能的不同“int 路由”的列表:

setAudioRoute (int routes)

setRouting (int mode, int routes, int mask)

我想找到一个具有不同 int 的列表,例如:

1 = 扬声器

2 = 蓝牙

3 = 耳机

【问题讨论】:

    标签: android audio bluetooth speaker audio-source


    【解决方案1】:

    您可以在本文档中找到可能的音频路由:CallAudioState

    我发现找到它的最佳方法是使用实​​际代码中的文档。如果您进入该文件,请查看该函数的文档:

       /**
         * Sets the audio route (speaker, bluetooth, etc...).  When this request is honored, there will
         * be change to the {@link #getCallAudioState()}.
         * <p>
         * Used by self-managed {@link ConnectionService}s which wish to change the audio route for a
         * self-managed {@link Connection} (see {@link PhoneAccount#CAPABILITY_SELF_MANAGED}.)
         * <p>
         * See also {@link InCallService#setAudioRoute(int)}.
         *
         * @param route The audio route to use (one of {@link CallAudioState#ROUTE_BLUETOOTH},
         *              {@link CallAudioState#ROUTE_EARPIECE}, {@link CallAudioState#ROUTE_SPEAKER}, or
         *              {@link CallAudioState#ROUTE_WIRED_HEADSET}).
         */
        public final void setAudioRoute(int route) {
            for (Listener l : mListeners) {
                l.onAudioRouteChanged(this, route, null);
            }
        }
    

    【讨论】:

      猜你喜欢
      • 2017-03-22
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 2012-11-03
      • 2016-10-12
      • 2016-10-03
      • 2015-04-02
      • 2016-10-05
      相关资源
      最近更新 更多