Nesta página, descrevemos como usar a Speech-to-Text para transcrever arquivos de áudio que incluem mais de um canal. O reconhecimento multicanal está disponível para todas as codificações de áudio compatíveis com o Speech-to-Text em até oito canais.
Se você estiver usando o AutoDetectDecodingConfig
,
não precisará especificar quantos canais de áudio o arquivo tem. Será determinado automaticamente. Especifique o número de canais de áudio somente ao usar o ExplicitDecodingConfig
.
Os dados de áudio geralmente incluem um canal para cada locutor presente na gravação. Por exemplo, o áudio de duas pessoas falando por telefone pode conter dois canais, em que cada linha é gravada separadamente.
Quando você envia uma solicitação com vários canais, o Speech-to-Text retorna um resultado que identifica os diferentes canais presentes no áudio, rotulando as alternativas para cada resultado com o campo channel_tag
.
Antes de começar
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Speech-to-Text APIs.
-
Make sure that you have the following role or roles on the project: Cloud Speech Administrator
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Acessar o IAM - Selecionar um projeto.
- Clique em CONCEDER ACESSO.
-
No campo Novos principais, insira seu identificador de usuário. Normalmente, é o endereço de e-mail de uma Conta do Google.
- Na lista Selecionar um papel, escolha um.
- Para conceder outros papéis, clique em Adicionar outro papel e adicione cada papel adicional.
- Clique em Salvar.
Install the Google Cloud CLI.
-
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Speech-to-Text APIs.
-
Make sure that you have the following role or roles on the project: Cloud Speech Administrator
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Acessar o IAM - Selecionar um projeto.
- Clique em CONCEDER ACESSO.
-
No campo Novos principais, insira seu identificador de usuário. Normalmente, é o endereço de e-mail de uma Conta do Google.
- Na lista Selecionar um papel, escolha um.
- Para conceder outros papéis, clique em Adicionar outro papel e adicione cada papel adicional.
- Clique em Salvar.
Install the Google Cloud CLI.
-
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Optional: Revoke the authentication credentials that you created, and delete the local credential file.
gcloud auth application-default revoke
-
Optional: Revoke credentials from the gcloud CLI.
gcloud auth revoke
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
- Pratique a transcrição de arquivos de áudio curtos.
- Saiba como transcrever streaming de áudio.
- Saiba como transcrever arquivos de áudio longos.
- Para dicas sobre como conseguir o melhor desempenho e precisão, entre outras, consulte a documentação sobre práticas recomendadas.
As bibliotecas de cliente podem usar o Application Default Credentials para autenticar facilmente com as APIs do Google e enviar solicitações para essas APIs. Com esse serviço, é possível testar seu aplicativo localmente e implantá-lo sem alterar o código subjacente. Para mais informações, consulte Autenticar para usar bibliotecas de cliente.
Verifique também se você instalou a biblioteca de cliente.
Executar o reconhecimento de fala síncrono em um arquivo multicanal
Este é um exemplo de reconhecimento de fala síncrono em um arquivo de áudio multicanal local:
Python
Limpar
Para evitar cobranças na sua conta do Google Cloud pelos recursos usados nesta página, siga estas etapas.
Console
gcloud
Delete a Google Cloud project:
gcloud projects delete PROJECT_ID