Table of Contents

Class OpenAISpeechGenerationRequest

Generates audio from the input text.

public class OpenAISpeechGenerationRequest : AIRequest, IValidatable, IAudioOutputRequest
Inheritance
object
OpenAISpeechGenerationRequest
Implements
IValidatable
IAudioOutputRequest
Inherited Members

Properties

AudioFormat

public AudioFormat AudioFormat { get; set; }

Property Value

AudioFormat

Prompt

Required. The input text to generate audio for. The maximum length is 4096 characters.

public string Prompt { get; set; }

Property Value

string

ResponseFormat

The format of the response.

public AudioEncoding? ResponseFormat { get; set; }

Property Value

AudioEncoding?

Speed

The speed of the generated audio. Select a value from 0.25 to 4.0.

public float? Speed { get; set; }

Property Value

float?

Remarks

1.0 is the default.

StreamFormat

Optional. Defaults to audio. Set this value to stream the audio response instead of returning it as a single response. The format to stream the audio in. Supported formats are sse and audio. sse is not supported for tts-1 or tts-1-hd.

public OpenAITypes.AudioStreamFormat? StreamFormat { get; set; }

Property Value

OpenAITypes.AudioStreamFormat?

Voice

Required. The voice to use when generating the audio. Supported voices are alloy, echo, fable, onyx, nova, and shimmer. Previews of the voices are available in the Text to speech guide.

public string Voice { get; set; }

Property Value

string

Methods

Validate()

public void Validate()