android - 我们能保证 Android 的 SpeechRecognizer 不会向 Google 发送数据吗?

标签 android speech-recognition offline privacy

我正在尝试实现 Android 的 SpeechRecognizer 功能。由于我公司的隐私限制,数据必须明确不要离开设备 .
至今:

  • 我已经使用 SpeechRecognizer.createSpeechRecognizer 实现了 SpeechRecognizer 类。方法。当我在没有互联网的情况下尝试它时,它工作得很好!
    但是,据我所知,谷歌不会在在线时发送数据,如果不是为了转录,然后是为了改进他们的音频训练数据。
  • SpeechRecognizer.createOnDeviceSpeechRecognizer - 这适用于 Android 12 及更高版本。假设我不介意。但是,它仅适用于特定设备,即。 Pixel 6 但甚至在 Pixel 4a 中也没有。
  • putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true) - 这也不起作用。它一直给我错误:ERROR_NO_MATCH ,在我尝试过的任何设备中。

  • 所以这给我们留下了简单的SpeechRecognizer.createSpeechRecognizer我的实现是这样的:
    var recognizerIntent: Intent? = null
            if (SpeechRecognizer.isRecognitionAvailable(applicationContext)) {
                sr = SpeechRecognizer.createSpeechRecognizer(applicationContext)
    
                val listener = MySpeechRecognitionListener(scopeProvider, lifecycleScope, {
                    ...
                }
                sr.setRecognitionListener(listener)
                recognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply {
                    putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH)
                }
                sr.startListening(recognizerIntent)
    } else {...}
    
    问题:
    我们能否以某种方式保证 Android 的 SpeechRecognizer 不会向 Google 发送数据?

    最佳答案

    利用:

    public static SpeechRecognizer createSpeechRecognizer (Context context, 
                    ComponentName serviceComponent)
    
    指定 serviceComponent那是开源的,因此您可以验证它不会向 Google 发送数据。
    我没有看到任何其他解决方案,即我不知道任何 Android API 标志,如 DONT_SEND_DATA_TO_GOOGLE .

    关于android - 我们能保证 Android 的 SpeechRecognizer 不会向 Google 发送数据吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70127164/

    相关文章:

    android - CoordinatorLayout 内的水平 RecyclerView

    android - 多次启动服务会在onStartCommand()中嵌套调用吗?

    java - JSONException : Value <! java.lang 类型的 DOCTYPE 无法转换为 JSONObject

    angular - SpeechRecognition 在 Windows 10 中的 Chrome 版本 60 上始终被阻止

    ios - 如何在 Parse.com iOS 上禁用离线错误警报?

    Linux 安装 libX11-devel

    顶部开始对齐的android centerCrop比例

    java - 使用 MARF 进行说话人识别

    c++ - 训练 sapi : Creating transcripted wav files and adding file paths to registry

    ios - Xamarin/IOS/Azure - 在类型上找不到 'id' 成员