谷歌语音转文本:除英语外,为其他语言创建本地化设置。

huangapple 未分类评论44阅读模式
英文:

Google Speech to Text Locale creation for language other than English

问题

我想在我的安卓应用中集成乌尔都语言使用谷歌的语音转文本功能根据谷歌的支持乌尔都语言是可以用于语音转文本的您能指导我如何创建这个功能吗

class AimyboxApplication : Application(), AimyboxProvider {

    companion object {
        private const val AIMYBOX_API_KEY = "Ldf0j7WZi3KwNah2aNeXVIACz0lb9qMH"
    }

    override val aimybox by lazy { createAimybox(this) }

    private fun createAimybox(context: Context): Aimybox {
        val unitId = UUID.randomUUID().toString()

        val textToSpeech = GooglePlatformTextToSpeech(context, Locale.UKRAINIAN)
        val speechToText = GooglePlatformSpeechToText(context, Locale.UKRAINIAN)

        val dialogApi = AimyboxDialogApi(AIMYBOX_API_KEY, unitId)

        return Aimybox(Config.create(speechToText, textToSpeech, dialogApi))
    }
}

如您在谷歌网站中所示,乌尔都巴基斯坦已被支持,因此您可以将语音转文本的Locale设置为乌尔都语言:

谷歌语音转文本:除英语外,为其他语言创建本地化设置。


<details>
<summary>英文:</summary>

I want to integrate Urdu Language in my android application using Google Speech to Text. Urdu language is supported according to google for speech to text. Can you guide me as to how I can create this:

    class AimyboxApplication : Application(), AimyboxProvider {

    companion object {
        private const val AIMYBOX_API_KEY = &quot;Ldf0j7WZi3KwNah2aNeXVIACz0lb9qMH&quot;
    }

    override val aimybox by lazy { createAimybox(this) }

    private fun createAimybox(context: Context): Aimybox {
        val unitId = UUID.randomUUID().toString()

        val textToSpeech = GooglePlatformTextToSpeech(context, Locale.ENGLISH)
        val speechToText = GooglePlatformSpeechToText(context, Locale.ENGLISH)

        val dialogApi = AimyboxDialogApi(AIMYBOX_API_KEY, unitId)

        return Aimybox(Config.create(speechToText, textToSpeech, dialogApi))
    }
}


It has Locale.English I want it for Urdu as shown on google here: 

[![][1]][1]


  [1]: https://i.stack.imgur.com/U4OGy.png

As you can see Urdu Pakistan is present on googles website.

</details>


# 答案1
**得分**: 0

你正在使用 Android SpeechKit 库(GooglePlatform),而不是 Google Cloud SpeechKit。我认为第一个仅支持英语,但你可以使用第二个,并且可以从 Google Cloud 控制台配置 API 的默认语言(为此,你需要一个活跃的计费账户),然后将其集成到 Aimubox。

参考文档及代码:https://github.com/just-ai/aimybox-android-sdk/tree/master/google-cloud-speechkit

<details>
<summary>英文:</summary>

You are using the android speechkit library (GooglePlatform), not the Google Cloud speechkit. I think the first one supports only English, but you can use the second one, and configure your API default language from Google Cloud Console (for that, you will need an active billing account), and then integrate it with aimubox.

Reference to documentation with code: https://github.com/just-ai/aimybox-android-sdk/tree/master/google-cloud-speechkit



  

</details>



huangapple
  • 本文由 发表于 2020年4月5日 03:20:43
  • 转载请务必保留本文链接:https://java.coder-hub.com/61033539.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定