Skip to content

OpenAI.AudioTranslation

Andrew Lambert edited this page Jul 14, 2024 · 7 revisions

OpenAI.AudioTranslation

Class Declaration

 Protected Class AudioTranslation
 Inherits OpenAI.AudioTranscription

Remarks

This class represents an API audio translation response. Refer to the OpenAI documentation on the /v1/audio/translations endpoint for further details.

Example

This example uploads a file for translation:

 OpenAI.APIKey = "YOUR API KEY"
 Dim file As FolderItem = SpecialFolder.Desktop.Child("speech.mp3")
 Dim reply As OpenAI.Response = OpenAI.AudioTranslation.Create(file)
 Dim translation As String = reply.GetResult()

This example requests the output in raw SRT (subtitles file) format.

 OpenAI.APIKey = "YOUR API KEY"
 Dim file As FolderItem = SpecialFolder.Desktop.Child("speech.mp3")
 Dim translation As String = OpenAI.AudioTranslation.CreateRaw(file, "srt")

Methods

Properties

Shared methods

Shared properties

Clone this wiki locally