This function reads an audio file and sends it to the Groq transcription API for transcription.
groq_transcribe(
.audio_file,
.model = "whisper-large-v3",
.language = NULL,
.prompt = NULL,
.temperature = 0,
.api_url = "https://api.groq.com/openai/v1/audio/transcriptions",
.dry_run = FALSE,
.verbose = FALSE,
.max_tries = 3
)
A character vector containing the transcription.
The path to the audio file (required). Supported formats include flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
The model to use for transcription (default: "whisper-large-v3").
The language of the input audio, in ISO-639-1 format (optional).
A prompt to guide the transcription style. It should match the audio language (optional).
Sampling temperature, between 0 and 1, with higher values producing more randomness (default: 0).
Base URL for the API (default: "https://api.groq.com/openai/v1/audio/transcriptions").
Logical; if TRUE, performs a dry run and returns the request object without making the API call (default: FALSE).
Logical; if TRUE, rate limiting info is displayed after the API request (default: FALSE).
Maximum retries to peform request
if (FALSE) {
# Basic usage
groq_transcribe(.audio_file = "example.mp3")
}
Run the code above in your browser using DataLab