You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language for transcriptions, or English for translations.
/// The format of the transcript output, should be one of the options in <see cref="AudioRequest.ResponseFormats"/>. See <seealso href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-response_format"/>
/// 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.
/// The format of the transcript output. See <seealso href="https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-response_format"/>
44
+
/// </summary>
45
+
publicstaticclassResponseFormats
46
+
{
47
+
#pragma warning disable CS1591// Missing XML comment for publicly visible type or member
48
+
publicconststringJSON="json";
49
+
publicconststringText="text";
50
+
publicconststringSRT="srt";
51
+
publicconststringVerboseJson="verbose_json";
52
+
publicconststringVTT="vtt";
53
+
#pragma warning restore CS1591// Missing XML comment for publicly visible type or member
Copy file name to clipboardexpand all lines: OpenAI_API/Audio/ITextToSpeechEndpoint.cs
+2-2
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ public interface ITextToSpeechEndpoint
30
30
/// <param name="responseFormat">The default response format is "mp3", but other formats are available in <see cref="TextToSpeechRequest.ResponseFormats"/>. See <seealso href="https://platform.openai.com/docs/guides/text-to-speech/supported-output-formats"/></param>
31
31
/// <param name="model">TTS is an AI model that converts text to natural sounding spoken text. OpenAI offers two different model variates, <see cref="Model.TTS_Speed"/> is optimized for real time text to speech use cases and <see cref="Model.TTS_HD"/> is optimized for quality.</param>
32
32
/// <returns>A stream of the audio file in the requested format.</returns>
/// Calls the API to create speech from text, and saves the audio file to disk.
@@ -50,7 +50,7 @@ public interface ITextToSpeechEndpoint
50
50
/// <param name="responseFormat">The default response format is "mp3", but other formats are available in <see cref="TextToSpeechRequest.ResponseFormats"/>. See <seealso href="https://platform.openai.com/docs/guides/text-to-speech/supported-output-formats"/></param>
51
51
/// <param name="model">TTS is an AI model that converts text to natural sounding spoken text. OpenAI offers two different model variates, <see cref="Model.TTS_Speed"/> is optimized for real time text to speech use cases and <see cref="Model.TTS_HD"/> is optimized for quality.</param>
52
52
/// <returns>A stream of the audio file in the requested format.</returns>
/// Transcribe audio into text, with optional translation into English.
8
+
/// </summary>
9
+
publicinterfaceITranscriptionEndpoint
10
+
{
11
+
/// <summary>
12
+
/// This allows you to set default parameters for every request, for example to set a default language. For every request, if you do not have a parameter set on the request but do have it set here as a default, the request will automatically pick up the default value.
13
+
/// </summary>
14
+
AudioRequestDefaultRequestArgs{get;set;}
15
+
16
+
/// <summary>
17
+
/// Gets the transcription of the audio stream, in the specified format
18
+
/// </summary>
19
+
/// <param name="audioStream">The stream containing audio data, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.</param>
20
+
/// <param name="filename">The name of the audio file in the stream. This does not have to be real, but it must contain the correct file extension. For example, "file.mp3" if you are supplying an mp3 audio stream.</param>
21
+
/// <param name="responseFormat">The format of the response. Suggested value are <see cref="AudioRequest.ResponseFormats.SRT"/> or <see cref="AudioRequest.ResponseFormats.VTT"/>. For text and Json formats, try <see cref="GetTranscriptionTextAsync(Stream, string, string, double?)"/> or <see cref="GetTranscriptionDetailsAsync(Stream, string, string, double?)"/> instead.</param>
22
+
/// <param name="language">The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.</param>
23
+
/// <param name="prompt">An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.</param>
24
+
/// <param name="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.</param>
25
+
/// <returns>A string of the transcribed text</returns>
/// Gets the transcription of the audio file, in the specified format
30
+
/// </summary>
31
+
/// <param name="audioFilePath">The local path to the audio file, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.</param>
32
+
/// <param name="responseFormat">The format of the response. Suggested value are <see cref="AudioRequest.ResponseFormats.SRT"/> or <see cref="AudioRequest.ResponseFormats.VTT"/>. For text and Json formats, try <see cref="GetTranscriptionTextAsync(Stream, string, string, double?)"/> or <see cref="GetTranscriptionDetailsAsync(Stream, string, string, double?)"/> instead.</param>
33
+
/// <param name="language">The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.</param>
34
+
/// <param name="prompt">An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.</param>
35
+
/// <param name="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.</param>
36
+
/// <returns>A string of the transcribed text</returns>
/// Gets the transcription of the audio stream, with full metadata
41
+
/// </summary>
42
+
/// <param name="audioStream">The stream containing audio data, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.</param>
43
+
/// <param name="filename">The name of the audio file in the stream. This does not have to be real, but it must contain the correct file extension. For example, "file.mp3" if you are supplying an mp3 audio stream.</param>
44
+
/// <param name="language">The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.</param>
45
+
/// <param name="prompt">An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.</param>
46
+
/// <param name="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.</param>
47
+
/// <returns>A string of the transcribed text</returns>
/// Gets the transcription of the audio file, with full metadata
52
+
/// </summary>
53
+
/// <param name="audioFilePath">The local path to the audio file, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.</param>
54
+
/// <param name="language">The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.</param>
55
+
/// <param name="prompt">An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.</param>
56
+
/// <param name="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.</param>
57
+
/// <returns>A string of the transcribed text</returns>
/// Gets the transcription of the audio stream as a text string
62
+
/// </summary>
63
+
/// <param name="audioStream">The stream containing audio data, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.</param>
64
+
/// <param name="filename">The name of the audio file in the stream. This does not have to be real, but it must contain the correct file extension. For example, "file.mp3" if you are supplying an mp3 audio stream.</param>
65
+
/// <param name="language">The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.</param>
66
+
/// <param name="prompt">An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.</param>
67
+
/// <param name="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.</param>
68
+
/// <returns>A string of the transcribed text</returns>
/// Gets the transcription of the audio file as a text string
73
+
/// </summary>
74
+
/// <param name="audioFilePath">The local path to the audio file, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.</param>
75
+
/// <param name="language">The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.</param>
76
+
/// <param name="prompt">An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.</param>
77
+
/// <param name="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.</param>
78
+
/// <returns>A string of the transcribed text</returns>
/// Constructor of the api endpoint. Rather than instantiating this yourself, access it through an instance of <see cref="OpenAIAPI"/> as <see cref="OpenAIAPI.Completions"/>.
27
+
/// Constructor of the api endpoint. Rather than instantiating this yourself, access it through an instance of <see cref="OpenAIAPI"/> as <see cref="OpenAIAPI.TextToSpeech"/>.
28
28
/// </summary>
29
29
/// <param name="api">Pass in the instance of the api</param>
@@ -48,7 +48,7 @@ public async Task<Stream> GetSpeechAsStreamAsync(TextToSpeechRequest request)
48
48
/// <param name="responseFormat">The default response format is "mp3", but other formats are available in <see cref="TextToSpeechRequest.ResponseFormats"/>. See <seealso href="https://platform.openai.com/docs/guides/text-to-speech/supported-output-formats"/></param>
49
49
/// <param name="model">TTS is an AI model that converts text to natural sounding spoken text. OpenAI offers two different model variates, <see cref="Model.TTS_Speed"/> is optimized for real time text to speech use cases and <see cref="Model.TTS_HD"/> is optimized for quality.</param>
50
50
/// <returns>A stream of the audio file in the requested format.</returns>
@@ -87,7 +87,7 @@ public async Task<FileInfo> SaveSpeechToFileAsync(TextToSpeechRequest request, s
87
87
/// <param name="responseFormat">The default response format is "mp3", but other formats are available in <see cref="TextToSpeechRequest.ResponseFormats"/>. See <seealso href="https://platform.openai.com/docs/guides/text-to-speech/supported-output-formats"/></param>
88
88
/// <param name="model">TTS is an AI model that converts text to natural sounding spoken text. OpenAI offers two different model variates, <see cref="Model.TTS_Speed"/> is optimized for real time text to speech use cases and <see cref="Model.TTS_HD"/> is optimized for quality.</param>
89
89
/// <returns>A stream of the audio file in the requested format.</returns>
/// Supported voices are alloy, echo, fable, onyx, nova, and shimmer. Previews of the voices are available in the Text to speech guide. See <seealso href="https://platform.openai.com/docs/guides/text-to-speech/voice-options"/>.
0 commit comments