generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added flash models - Added stream input support to dubbing endpoint - Fixed http/https protocol in client settings --------- Co-authored-by: evya5 <76632693+evya5@users.noreply.github.com>
- Loading branch information
1 parent
3f51d46
commit 689ad11
Showing
10 changed files
with
150 additions
and
24 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
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
64 changes: 64 additions & 0 deletions
64
ElevenLabs/Packages/com.rest.elevenlabs/Runtime/Dubbing/DubbingStream.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,64 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using System.IO; | ||
|
||
namespace ElevenLabs.Dubbing | ||
{ | ||
public sealed class DubbingStream : IDisposable | ||
{ | ||
public DubbingStream(Stream stream, string name, string mediaType) | ||
{ | ||
Stream = stream ?? throw new ArgumentNullException(nameof(stream)); | ||
|
||
if (Stream.Length == 0) | ||
{ | ||
throw new ArgumentException("Stream cannot be empty."); | ||
} | ||
|
||
if (!Stream.CanRead) | ||
{ | ||
throw new ArgumentException("Stream must be readable."); | ||
} | ||
|
||
Name = name ?? throw new ArgumentNullException(nameof(name)); | ||
|
||
if (string.IsNullOrWhiteSpace(Name)) | ||
{ | ||
throw new ArgumentException("Name cannot be empty."); | ||
} | ||
|
||
MediaType = mediaType ?? throw new ArgumentNullException(nameof(mediaType)); | ||
|
||
if (string.IsNullOrWhiteSpace(MediaType)) | ||
{ | ||
throw new ArgumentException("Media type cannot be empty."); | ||
} | ||
|
||
if (MediaType.Contains("/")) | ||
{ | ||
var parts = MediaType.Split('/'); | ||
|
||
if (parts.Length != 2 || string.IsNullOrWhiteSpace(parts[0]) || string.IsNullOrWhiteSpace(parts[1])) | ||
{ | ||
throw new ArgumentException("Invalid media type."); | ||
} | ||
} | ||
else | ||
{ | ||
throw new ArgumentException("Invalid media type."); | ||
} | ||
} | ||
|
||
public Stream Stream { get; } | ||
|
||
public string Name { get; } | ||
|
||
public string MediaType { get; } | ||
|
||
public void Dispose() | ||
{ | ||
Stream?.Dispose(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
ElevenLabs/Packages/com.rest.elevenlabs/Runtime/Dubbing/DubbingStream.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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