Table of Contents

Class AudioTranslationRequest

Namespace
OpenAI.Audio
Assembly
OpenAI-DotNet.dll
public sealed class AudioTranslationRequest : IDisposable
Inheritance
AudioTranslationRequest
Implements
Inherited Members

Constructors

AudioTranslationRequest(Stream, string, string, string, AudioResponseFormat, float?)

Constructor.

public AudioTranslationRequest(Stream audio, string audioName, string model = null, string prompt = null, AudioResponseFormat responseFormat = AudioResponseFormat.Json, float? temperature = null)

Parameters

audio Stream

The audio file to translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

audioName string

The name of the audio file to translate.

model string

ID of the model to use. Only whisper-1 is currently available.

prompt string

Optional, An optional text to guide the model's style or continue a previous audio segment.
The prompt should be in English.

responseFormat AudioResponseFormat

Optional, The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
Defaults to json.

temperature float?

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
Defaults to 0

AudioTranslationRequest(string, string, string, AudioResponseFormat, float?)

Constructor.

public AudioTranslationRequest(string audioPath, string model = null, string prompt = "response should be in english.", AudioResponseFormat responseFormat = AudioResponseFormat.Json, float? temperature = null)

Parameters

audioPath string

The audio file to translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

model string

ID of the model to use. Only whisper-1 is currently available.

prompt string

Optional, An optional text to guide the model's style or continue a previous audio segment.
The prompt should be in English.

responseFormat AudioResponseFormat

Optional, The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
Defaults to json.

temperature float?

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
Defaults to 0

Properties

Audio

The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.

public Stream Audio { get; }

Property Value

Stream

AudioName

The name of the audio file to translate.

public string AudioName { get; }

Property Value

string

Model

ID of the model to use. Only whisper-1 is currently available.

public string Model { get; }

Property Value

string

Prompt

Optional, An optional text to guide the model's style or continue a previous audio segment.
The prompt should be in English.

public string Prompt { get; }

Property Value

string

ResponseFormat

Optional, The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
Defaults to json.

public AudioResponseFormat ResponseFormat { get; }

Property Value

AudioResponseFormat

Temperature

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
Defaults to 0

public float? Temperature { get; }

Property Value

float?

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~AudioTranslationRequest()

protected ~AudioTranslationRequest()