Spaces:
Sleeping
Sleeping
Download src/ClipForge.Api/Endpoints/VoiceEndpoints.cs from clipeforge/app: direct link, hf CLI and curl.
- Browser
- Download file 857 Bytes
-
https://huggingface.co/spaces/clipeforge/app/resolve/main/src/ClipForge.Api/Endpoints/VoiceEndpoints.cs
- Command line
-
hf download hf://spaces/clipeforge/app/src/ClipForge.Api/Endpoints/VoiceEndpoints.cs
-
curl -L -o VoiceEndpoints.cs https://huggingface.co/spaces/clipeforge/app/resolve/main/src/ClipForge.Api/Endpoints/VoiceEndpoints.cs
857 Bytes
| using ClipForge.Contracts.Requests; | |
| using ClipForge.Core.Interfaces.Services; | |
| namespace ClipForge.Api.Endpoints; | |
| public static class VoiceEndpoints | |
| { | |
| public static void MapVoiceEndpoints(this WebApplication app) | |
| { | |
| var group = app.MapGroup("/api/voice").WithTags("Voice"); | |
| group.MapPost("/generate", async (GenerateVoiceRequest request, IVoiceGenerationService service) => | |
| { | |
| var voice = await service.GenerateVoiceAsync(request.ScriptId, request.VoiceId); | |
| return Results.Ok(new | |
| { | |
| voice.Id, | |
| voice.VideoScriptId, | |
| voice.FilePath, | |
| voice.VoiceProvider, | |
| voice.VoiceId, | |
| voice.DurationSeconds, | |
| voice.FileSizeBytes, | |
| voice.CreatedAt | |
| }); | |
| }); | |
| } | |
| } | |