Pre-Recorded Audio Transcription
The Deepgram has a package that allows you to request transcripts for pre-recorded audio. To request a transcript for a pre-recorded particular audio file, you’ll use one of the following functions depending on your audio source:
Pre-recorded Transcription Parameters
The input parameters for the three types of Prerecorded transcription (FromFile, FromStream, and FromURL) are geared toward the type of audio source.
Sending a URL
Sending a Local File
NOTE: When attempting to access a file for transcription, make sure you have the correct file permissions for the user on the filesystem.
Sending an io.Reader
The io.Reader is a standard Go interface used primarily for streaming bytes from various sources. These sources could include files, HTTP(S) endpoints, etc. Anything that implements this interface can be passed to stream bytes for transcription.
Pre-recorded Transcription Options
Additional transcription options can be provided for pre-recorded transcriptions. They are provided as an object as the second parameter of the transcription function. Each of these parameters maps to a feature in the Deepgram API. Reference the features documentation to learn the appropriate features for your request.
Pre-recorded Transcription Example Request
Using the transcription from a URL functionality above (FromURL
), the required inputs are a Go Context, a URL, and additional transcription options. The output will be of type `PreRecordedResponse’, which contains the conversation transcription based on the options provided.
Where To Find Additional Examples
The repository has a good collection of live audio transcription examples. You can find links to them in the README. Each example below will attempt to provide different options for transcribing an audio source.
- From an Audio File - examples/prerecorded/file
- From an URL - examples/prerecorded/url
- From an Audio Stream - examples/prerecorded/stream
For larger files, you might need to increase the default HTTP Timeout setting, which is 300 seconds (or 5 mins).