Cloud Speech-to-Text è un'API che converte la voce in testo prendendo i dati audio come input e restituendo una trascrizione di testo utilizzando la tecnologia AI di Google. Questa pagina mostra come configurare l'API Cloud Speech-to-Text per il tuo progetto in modo da poter iniziare a effettuare chiamate all'API.
Questo documento tratta i seguenti argomenti:
- Attivazione e disattivazione dell'API Cloud Speech-to-Text per un progetto Google Cloud
- Abilitare la fatturazione per Cloud Speech-to-Text
- (Facoltativo) Creazione di un nuovo bucket Google Cloud Storage per archiviare i dati audio per file di grandi dimensioni
Questo documento non descrive come iniziare a inviare e ricevere richieste utilizzando l'API Cloud Speech-to-Text. Per informazioni su come iniziare a integrare Cloud Speech-to-Text nel tuo codice effettivo, consulta la nostra pagina di panoramica.
Prima di iniziare
Esistono due modi per accedere al servizio: utilizzando l'API REST o la consoleGoogle Cloud .
Questa guida illustra i passaggi necessari per iniziare a inviare richieste all'API REST. Se non hai mai programmato, ti consigliamo di iniziare con i tutorial passo passo nella console della Google Cloud piattaforma prima di iniziare questi passaggi.
Abilita l'API Cloud Speech-to-Text per il tuo Google Cloud progetto
Accedi alla Google Cloud console.
Apri la pagina di selezione del progetto e scegli un progetto esistente o creane uno nuovo. Per saperne di più sulla creazione di un progetto, consulta la pagina Creare e gestire progetti.
Se crei un nuovo progetto, ti verrà chiesto di collegare un account di fatturazione al progetto. Se utilizzi un progetto preesistente, assicurati di aver abilitato la fatturazione.
Scopri come verificare che la fatturazione sia abilitata per il tuo progetto
Abilita l'API Cloud Speech-to-Text. Fai clic sul campo di testo Cerca prodotti e risorse nella parte superiore della pagina e digita "speech". Seleziona l'API Cloud Speech-to-Text dall'elenco dei risultati.
Per abilitare l'API Cloud Speech-to-Text in modo da utilizzarla nel progetto, fai clic su Abilita. Per provare Cloud Speech-to-Text senza collegarlo al tuo progetto, fai clic su Prova questa API.
(Facoltativo) (solo API V1) Abilita il logging dei dati. Attivando il logging dei dati, consenti a Google di registrare i dati audio che invii a Cloud Speech-to-Text. Questi dati vengono utilizzati per migliorare i modelli di Cloud Speech-to-Text. Gli utenti che attivano il logging dei dati traggono beneficio da prezzi più bassi. Per ulteriori informazioni, consulta le pagine relative ai prezzi e ai Termini e condizioni di registrazione dei dati.
(Facoltativo) Crea un bucket Cloud Storage
Se intendi trascrivere audio di durata superiore a 60 secondi o con una dimensione del file superiore a 10 MB, devi archiviare i dati audio in un bucket Cloud Storage prima di poterli trascrivere utilizzando Cloud Speech-to-Text.
Per creare un nuovo bucket Cloud Storage:
- In the Google Cloud console, go to the Cloud Storage Buckets page.
- Click Create.
- On the Create a bucket page, enter your bucket information. To go to the next
step, click Continue.
- For Name your bucket, enter a unique bucket name. Don't include sensitive information in the bucket name, because the bucket namespace is global and publicly visible.
-
In the Choose where to store your data section, do the following:
- Select a Location type.
- Choose a location where your bucket's data is permanently stored from the Location type drop-down menu.
- If you select the dual-region location type, you can also choose to enable turbo replication by using the relevant checkbox.
- To set up cross-bucket replication, select
Add cross-bucket replication via Storage Transfer Service and
follow these steps:
Set up cross-bucket replication
- In the Bucket menu, select a bucket.
In the Replication settings section, click Configure to configure settings for the replication job.
The Configure cross-bucket replication pane appears.
- To filter objects to replicate by object name prefix, enter a prefix that you want to include or exclude objects from, then click Add a prefix.
- To set a storage class for the replicated objects, select a storage class from the Storage class menu. If you skip this step, the replicated objects will use the destination bucket's storage class by default.
- Click Done.
-
In the Choose how to store your data section, do the following:
- Select a default storage class for the bucket or Autoclass for automatic storage class management of your bucket's data.
- To enable hierarchical namespace, in the Optimize storage for data-intensive workloads section, select Enable hierarchical namespace on this bucket.
- In the Choose how to control access to objects section, select whether or not your bucket enforces public access prevention, and select an access control method for your bucket's objects.
-
In the Choose how to protect object data section, do the
following:
- Select any of the options under Data protection that you
want to set for your bucket.
- To enable soft delete, click the Soft delete policy (For data recovery) checkbox, and specify the number of days you want to retain objects after deletion.
- To set Object Versioning, click the Object versioning (For version control) checkbox, and specify the maximum number of versions per object and the number of days after which the noncurrent versions expire.
- To enable the retention policy on objects and buckets, click the Retention (For compliance) checkbox, and then do the following:
- To enable Object Retention Lock, click the Enable object retention checkbox.
- To enable Bucket Lock, click the Set bucket retention policy checkbox, and choose a unit of time and a length of time for your retention period.
- To choose how your object data will be encrypted, expand the Data encryption section (), and select a Data encryption method.
- Select any of the options under Data protection that you
want to set for your bucket.
- Click Create.
- Vai alla tua Google Cloud dashboard e fai clic su Vai alla panoramica delle API.
- Seleziona l'API Cloud Speech-to-Text.
- Fai clic su Disabilita API.
Disabilita l'API Cloud Speech-to-Text
Se non hai più bisogno di utilizzare l'API Cloud Speech-to-Text con il tuo progetto:
Passaggi successivi
Scopri come inviare una richiesta di trascrizione all'API Cloud Speech-to-Text utilizzando le librerie client, gcloud, la riga di comando o la UI Speech-to-Text.