Transcribe Audio from Data URI Using OpenAI's Whisper Model
Source:R/api-transcribe-audio.R
transcribe_audio.Rd
This function takes an audio file in data URI format, converts it to WAV, and sends it to OpenAI's transcription API to get the transcribed text.
Usage
transcribe_audio(audio_input, api_key = Sys.getenv("OPENAI_API_KEY"))
Examples
if (FALSE) { # \dontrun{
audio_uri <- "data:audio/webm;base64,SGVsbG8gV29ybGQ=" # Example data URI
transcription <- transcribe_audio(audio_uri)
print(transcription)
} # }