Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Transcribe ¶
func Transcribe(ctx context.Context, filenames []string, opts TranscribeOptions, options ...transcribeOption) (map[string]string, error)
Transcribe uses the Google Cloud Speech-to-Text API to transcribe an audio file. It takes a context, the filename of the audio file to transcribe, and a TranscribeOptions struct which contains the Google Cloud credentials, the GCS bucket to upload the audio file to, the language code to use for transcription, a potion to enable diarization including the min and max speakers and an option to clean up the audio file from GCS after transcription is complete. It returns the transcript of the audio file as a string and an error if the transcription fails.
func WithTranscriber ¶
func WithTranscriber(t transcriber) transcribeOption
Types ¶
type TranscribeOptions ¶
type TranscribeOptions = common.TranscribeOptions
The TranscribeOptions struct contains the options for transcribing an audio file. It allows the user to specify the Google Cloud credentials, the GCS bucket to upload the audio file to, the language code to use for transcription, a potion to enable diarization including the min and max speakers and an option to clean up the audio file from GCS after transcription is complete.
And also, it allows the user to specify whether to use the Whisper API for transcription, and if so, the API key, model, and prompt to use.