Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#49 style bert vit2周りの細かい修正 #50

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KoeBook.Core/Services/ClaudeAnalyzerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private Dictionary<string, string> ExtractCharacterVoiceMapping(string response,
.Select(l =>
{
var characterId = l[1..l.IndexOf('.')];
var voiceTypeSpan = l.AsSpan()[(l.IndexOf(':') + 2)..];
var voiceTypeSpan = l.AsSpan()[(l.IndexOf(':') + 2)..].Trim();
// ボイス割り当てが複数あたったときに先頭のものを使う(例:群衆 AdultMan, AdultWoman)
var separatorIndex = voiceTypeSpan.IndexOfAny(_searchValues);
if (separatorIndex > 0)
Expand Down
2 changes: 1 addition & 1 deletion KoeBook.Core/Services/SoundGenerationSelectorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public async ValueTask InitializeAsync(CancellationToken cancellationToken)
.GetFromJsonAsync<Dictionary<string, ModelInfo>>("/models/info", ExceptionType.InitializeFailed, cancellationToken)
.ConfigureAwait(false);

Models = models.Select(kvp => new SoundModel(kvp.Key, kvp.Value.FirstSpk, kvp.Value.Styles)).ToArray();
Models = models.Select(kvp => new SoundModel(kvp.Key, kvp.Value.FirstSpk.Replace(" ", ""), kvp.Value.Styles)).ToArray();
}
catch (EbookException e) when (e.ExceptionType == ExceptionType.UnknownStyleBertVitsRoot) { }
}
Expand Down
4 changes: 2 additions & 2 deletions KoeBook.Core/Services/SoundGenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public async ValueTask<byte[]> GenerateLineSoundAsync(ScriptLine scriptLine, Boo
var queryCollection = HttpUtility.ParseQueryString(string.Empty);
queryCollection.Add("text", scriptLine.Text);
queryCollection.Add("model_id", soundModel.Id);
queryCollection.Add("style", scriptLine.Style);
queryCollection.Add("style", style);
return await _styleBertVitsClientService
.GetAsByteArrayAsync($"/voice/{queryCollection}", ExceptionType.SoundGenerationFailed, cancellationToken).ConfigureAwait(false);
.GetAsByteArrayAsync($"/voice?{queryCollection}", ExceptionType.SoundGenerationFailed, cancellationToken).ConfigureAwait(false);
}
}
Loading