Skip to content

Commit

Permalink
#49 style bert vit2周りの細かい修正
Browse files Browse the repository at this point in the history
  • Loading branch information
aiueo-1234 committed May 2, 2024
1 parent 2679c64 commit 8b2008b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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);
}
}

0 comments on commit 8b2008b

Please sign in to comment.