Cloud Speech-to-Text adalah API yang mengonversi ucapan menjadi teks dengan mengambil data audio sebagai input dan menghasilkan transkripsi teks menggunakan teknologi AI Google. Halaman ini menunjukkan cara menyiapkan Cloud Speech-to-Text API untuk project Anda sehingga Anda dapat mulai melakukan panggilan ke API.
Dokumen ini membahas topik-topik berikut:
- Mengaktifkan dan menonaktifkan Cloud Speech-to-Text API untuk project Google Cloud
- Mengaktifkan penagihan untuk Cloud Speech-to-Text
- Opsional: Membuat bucket Storage baru untuk menyimpan data audio Anda untuk ukuran file besar Google Cloud
Dokumen ini tidak membahas cara mulai mengirim dan menerima permintaan menggunakan Cloud Speech-to-Text API. Untuk mengetahui informasi tentang cara mulai mengintegrasikan Cloud Speech-to-Text ke dalam kode Anda yang sebenarnya, lihat halaman ringkasan kami.
Sebelum memulai
Ada dua cara untuk mengakses layanan ini: menggunakan REST API dan menggunakan konsolGoogle Cloud .
Panduan ini membahas langkah-langkah yang diperlukan untuk mulai mengirim permintaan ke REST API. Jika Anda baru mengenal coding, sebaiknya mulai dengan tutorial langkah demi langkah dalam konsol di Google CloudPlatform sebelum memulai langkah-langkah ini.
Aktifkan Cloud Speech-to-Text API untuk Google Cloud project Anda
Login ke Google Cloud konsol.
Buka pemilih project page dan pilih project yang sudah ada atau buat project baru. Untuk informasi selengkapnya tentang cara membuat project, lihat Membuat dan mengelola project.
Jika membuat project baru, Anda akan diminta untuk menautkan akun penagihan ke project ini. Jika menggunakan project yang sudah ada, pastikan Anda telah mengaktifkan penagihan.
Pelajari cara mengonfirmasi bahwa penagihan diaktifkan untuk project Anda
Aktifkan Cloud Speech-to-Text API. Klik kolom teks Search products and resources di bagian atas halaman, lalu ketik "speech". Pilih Cloud Speech-to-Text API dari daftar hasil.
Untuk mengaktifkan Cloud Speech-to-Text API agar dapat digunakan dengan project Anda, klik Enable. Untuk mencoba Cloud Speech-to-Text tanpa menautkannya ke project Anda, klik Try this API.
Opsional: (Khusus API V1) Aktifkan logging data. Dengan memilih mengaktifkan logging data, Anda mengizinkan Google merekam data audio apa pun yang Anda kirim ke Cloud Speech-to-Text. Data ini digunakan untuk meningkatkan kualitas model Cloud Speech-to-Text. Pengguna yang memilih mengaktifkan logging data akan mendapatkan manfaat berupa harga yang lebih rendah. Lihat halaman harga serta persyaratan dan ketentuan logging data untuk mengetahui informasi selengkapnya.
Opsional: Membuat bucket Cloud Storage
Jika ingin mentranskripsi audio dengan durasi lebih dari 60 detik atau ukuran file lebih dari 10 MB, Anda harus menyimpan data audio ini di bucket Cloud Storage agar dapat mentranskripsikannya menggunakan Cloud Speech-to-Text.
Untuk membuat bucket Cloud Storage baru:
- 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.
- Buka dasbor Google Cloud , lalu klik Go to APIs overview.
- Pilih Cloud Speech-to-Text API.
- Klik Disable API.
Menonaktifkan Cloud Speech-to-Text API
Jika Anda tidak perlu lagi menggunakan Cloud Speech-to-Text API dengan project Anda:
Langkah berikutnya
Pelajari cara mengirim permintaan transkripsi ke Cloud Speech-to-Text API menggunakan library klien, gcloud, command line, atau UI Speech-to-Text.