Table of Contents

Class AudioTranscriptionRequest

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

Constructors

AudioTranscriptionRequest(Stream, string, string, string, AudioResponseFormat, float?, string, TimestampGranularity)

Constructor.

public AudioTranscriptionRequest(Stream audio, string audioName, string model = null, string prompt = null, AudioResponseFormat responseFormat = AudioResponseFormat.Json, float? temperature = null, string language = null, TimestampGranularity timestampGranularity = TimestampGranularity.None)

Parameters

audio Stream

The audio stream to transcribe.

audioName string

The name of the audio file to transcribe.

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

language string

Optional, The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
Currently supported languages: Afrikaans, Arabic, Armenian, Azerbaijani, Belarusian, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Kannada, Kazakh, Korean, Latvian, Lithuanian, Macedonian, Malay, Marathi, Maori, Nepali, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tagalog, Tamil, Thai, Turkish, Ukrainian, Urdu, Vietnamese, and Welsh.

timestampGranularity TimestampGranularity

The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: Word, or Segment.
Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.

AudioTranscriptionRequest(string, string, string, AudioResponseFormat, float?, string, TimestampGranularity)

Constructor.

public AudioTranscriptionRequest(string audioPath, string model = null, string prompt = null, AudioResponseFormat responseFormat = AudioResponseFormat.Json, float? temperature = null, string language = null, TimestampGranularity timestampGranularity = TimestampGranularity.None)

Parameters

audioPath string

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

model string

ID of the model to use.

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

language string

Optional, The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
Currently supported languages: Afrikaans, Arabic, Armenian, Azerbaijani, Belarusian, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Kannada, Kazakh, Korean, Latvian, Lithuanian, Macedonian, Malay, Marathi, Maori, Nepali, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tagalog, Tamil, Thai, Turkish, Ukrainian, Urdu, Vietnamese, and Welsh.

timestampGranularity TimestampGranularity

The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: Word, or Segment.
Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.

Properties

Audio

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

public Stream Audio { get; }

Property Value

Stream

AudioName

The name of the audio file to transcribe.

public string AudioName { get; }

Property Value

string

Language

Optional, The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
Currently supported languages: Afrikaans, Arabic, Armenian, Azerbaijani, Belarusian, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Kannada, Kazakh, Korean, Latvian, Lithuanian, Macedonian, Malay, Marathi, Maori, Nepali, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tagalog, Tamil, Thai, Turkish, Ukrainian, Urdu, Vietnamese, and Welsh.

public string Language { 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?

TimestampGranularities

The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: Word, or Segment.
Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.

public TimestampGranularity TimestampGranularities { get; }

Property Value

TimestampGranularity

Methods

Dispose()

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

public void Dispose()

~AudioTranscriptionRequest()

protected ~AudioTranscriptionRequest()