Transcribing Media
In this guide you'll learn how to transcribe a media file
Prerequisites
You must have an OAuth Client ID & Secret
You must have a user access token, obtainable via API Authentication
You must have some media to upload, for example an MP3 (a sample is provided below)
Your application must have the scopes:
write_mediawrite_transcriptions
Steps
Authenticate
You need an access token to follow the steps below, you can find out about how to obtain one in the API Authentication guide.
API AuthenticationCreate a media object
First we'll create a media object. This will be our reference for any files we upload to Google Cloud storage directly.
API ReferenceYou can go to the API reference on how to do this, below is an example in cURL:
The response should look something like this:
The important part we need next is the signed_url_for_upload in the next request we'll do a PUT request to this URL.
Upload your media
Now that we have a URL for uploading we can upload our MP3.
API ReferenceYou can go to the API reference on how to do this, below is an example in cURL. You'll need to supply the same Content-Type header as you did when you created the media object.
Note: The above cURL command will only work if it is run in the same directory as the steve_jobs.mp3 file.
If that was successful you'll get an empty body response with a 200 OK status code.
Create a transcription
Lastly, now the media has been uploaded we'll use it to create a transcription.
API ReferenceYou can go to the API reference on how to do this, below is an example in cURL.
Note the JSON body should contain a top-level object with key of source where the value is an object containing two keys:
typewhich must have the valuemediaidwhich must have the ID of media that you created before
If this is successful you should receive a 201 Created status and response that looks like the following:
You're all done!
If you've reached this step you have successfully transcribed some media and it will show within your account.
Last updated
Was this helpful?