Struct ResponseFormat
A response_format value. The wire type is a string; use the static instances or
construct from any string the server accepts (an unknown value is rejected by the server).
public readonly struct ResponseFormat : IEquatable<ResponseFormat>
- Implements
- Inherited Members
Constructors
ResponseFormat(string)
Creates a format from its wire string.
public ResponseFormat(string value)
Parameters
valuestringThe wire string, e.g.
wav.
Fields
Json
JSON object carrying Base64 WAV.
public static readonly ResponseFormat Json
Field Value
Mp3
MP3 bytes (only builds with the mp3_encode frontend module).
public static readonly ResponseFormat Mp3
Field Value
Pcm
Raw PCM16 bytes.
public static readonly ResponseFormat Pcm
Field Value
Wav
WAV bytes (default).
public static readonly ResponseFormat Wav
Field Value
Properties
Value
The wire string.
public string Value { get; }
Property Value
Methods
Equals(ResponseFormat)
public bool Equals(ResponseFormat other)
Parameters
otherResponseFormat
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
implicit operator string(ResponseFormat)
Implicit conversion to string.
public static implicit operator string(ResponseFormat format)
Parameters
formatResponseFormatThe format.
Returns
- string
The wire string.
implicit operator ResponseFormat(string)
Implicit conversion from string.
public static implicit operator ResponseFormat(string value)
Parameters
valuestringThe wire string.
Returns
- ResponseFormat
The format.