generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added support for streaming text to speech - Added AudioEndpoit.CreateSpeechStreamAsync(SpeechRequest, Action<AudioClip>, CancellationToken) - Added support for Audio Transcription and Translation verbose json output - Added support for timestamp granularities for segments and words - Marked CreateTranscriptionAsync obsolete - Added CreateTranscriptionTextAsync - Added CreateTranscriptionJsonAsync - Marked CreateTranspationAsync obsolete - Added CreateTranslationTextAsync - Added CreateTranslationJsonAsync - Updated SpeechResponseFormat to include wav and pcm
- Loading branch information
1 parent
052512c
commit 93eed23
Showing
19 changed files
with
623 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
OpenAI/Packages/com.openai.unity/Runtime/Audio/AudioResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Newtonsoft.Json; | ||
using UnityEngine.Scripting; | ||
|
||
namespace OpenAI.Audio | ||
{ | ||
[Preserve] | ||
public class AudioResponse | ||
{ | ||
[Preserve] | ||
[JsonConstructor] | ||
public AudioResponse( | ||
[JsonProperty("language")] string language, | ||
[JsonProperty("duration")] double? duration, | ||
[JsonProperty("text")] string text, | ||
[JsonProperty("words")] TranscriptionWord[] words, | ||
[JsonProperty("segments")] TranscriptionSegment[] segments) | ||
{ | ||
Language = language; | ||
Duration = duration; | ||
Text = text; | ||
Words = words; | ||
Segments = segments; | ||
} | ||
|
||
/// <summary> | ||
/// The language of the input audio. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("language")] | ||
public string Language { get; } | ||
|
||
/// <summary> | ||
/// The duration of the input audio. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("duration")] | ||
public double? Duration { get; } | ||
|
||
/// <summary> | ||
/// The transcribed text. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("text")] | ||
public string Text { get; } | ||
|
||
/// <summary> | ||
/// Extracted words and their corresponding timestamps. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("words")] | ||
public TranscriptionWord[] Words { get; } | ||
|
||
/// <summary> | ||
/// Segments of the transcribed text and their corresponding details. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("segments")] | ||
public TranscriptionSegment[] Segments { get; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
OpenAI/Packages/com.openai.unity/Runtime/Audio/AudioResponse.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.