摘要:国际化语音识别,适用于搜索,AI聊天等场景
需要在Google Cloud Console中启用 Google Cloud Speech-to-Text API 服务。
代码中使用的权限范围是:
https://www.googleapis.com/auth/cloud-platform
这是一个广泛的权限范围,允许访问所有Google Cloud服务,包括Speech-to-Text API。
为服务账号分配以下角色之一:
需要创建一个服务账号并下载JSON格式的密钥文件,保存到 storage_path('app/google/speech.json') 路径。