Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Nov 15, 2024
1 parent 21bb877 commit e991108
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions OpenAI-DotNet/Common/InputAudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ namespace OpenAI
{
public sealed class InputAudio
{
public InputAudio() { }

public InputAudio(ReadOnlyMemory<byte> memory, InputAudioFormat format)
: this(memory.Span, format)
{
}

public InputAudio(ReadOnlySpan<byte> span, InputAudioFormat format)
: this($"data:audio/{format};base64,{Convert.ToBase64String(span)}", format)
{
}

public InputAudio(byte[] data, InputAudioFormat format)
: this($"data:audio/{format};base64,{Convert.ToBase64String(data)}", format)
{
Expand Down

0 comments on commit e991108

Please sign in to comment.