Class SpeechGenerationRequest
Task for generating synthetic speech (text-to-speech) using the specified model.
public class SpeechGenerationRequest : SpeechGenerationRequestBase<SpeechGenerationRequest, Prompt>, IGenerativeRequest, ISequentialRequest
- Inheritance
-
objectGenerativeRequest<SpeechGenerationRequest, Prompt, Generated<AudioClip>, float[], IGenerativeAudioEvent>SpeechGenerationRequest
- Implements
- Inherited Members
- Extension Methods
Constructors
SpeechGenerationRequest(Prompt)
public SpeechGenerationRequest(Prompt prompt)
Parameters
promptPrompt
Properties
Language
public SystemLanguage? Language { get; set; }
Property Value
- SystemLanguage?
ModelType
public override ModelType ModelType { get; }
Property Value
ResponseMimeType
public override MimeType ResponseMimeType { get; set; }
Property Value
- MimeType
Speed
public float? Speed { get; set; }
Property Value
- float?
Type
public override FluentApiRequestType Type { get; }
Property Value
Methods
CreateStreamAsyncInternal()
protected override UniTask<IRESTStream<IGenerativeAudioEvent>> CreateStreamAsyncInternal()
Returns
- UniTask<IRESTStream<IGenerativeAudioEvent>>
ExecuteAsyncInternal()
protected override UniTask<Generated<AudioClip>> ExecuteAsyncInternal()
Returns
- UniTask<Generated<AudioClip>>
SetLanguage(SystemLanguage)
Sets the language of the synthesized speech. This can improve pronunciation and accuracy for non-English languages.
public SpeechGenerationRequest SetLanguage(SystemLanguage language)
Parameters
languageSystemLanguage
Returns
SetSpeed(float)
Sets the playback speed of the synthesized voice.
public SpeechGenerationRequest SetSpeed(float speed)
Parameters
speedfloat