4

我正在尝试将语音操作添加到我的music app. 当我做语音动作并说:

Someone like you

在此处输入图像描述

谷歌语音搜索识别出它是一首歌曲,它让用户选择打开这个意图的应用程序(包括我的应用程序)。单击我的应用程序时,我按预期收到了索尼名称。

我注意到我可以说:

Someone like you继续播放Google Music

在此处输入图像描述

这将让谷歌语音搜索在短暂的超时后直接打开谷歌音乐。

=-=-=

所以不起作用的是我不能使用Play [Music] on [My App];这会给我一个谷歌搜索结果。

在此处输入图像描述

我基本上从这个博客复制了我的代码,我想知道我是否需要做任何额外的Play [Music] on [My App]工作才能工作?

这是我的清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.kylelam.musicvoiceaction" >

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>

            <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
            <category android:name="android.intent.category.DEFAULT" />


            <action android:name="android.intent.action.MAIN" />


            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>
4

0 回答 0