From 749863e269fd4f0f7f8a01e12202bf2a61e68702 Mon Sep 17 00:00:00 2001 From: aiueo-1234 <130837816+aiueo-1234@users.noreply.github.com> Date: Fri, 3 May 2024 14:05:02 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#54=20mp3=E3=81=A8wav=E3=81=A7totaltime?= =?UTF-8?q?=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=8B=E3=81=93=E3=81=A8=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E5=AF=BE=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Epub/KoeBook.Epub/Services/EpubGenerateService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Epub/KoeBook.Epub/Services/EpubGenerateService.cs b/Epub/KoeBook.Epub/Services/EpubGenerateService.cs index 51423a7..3b10b73 100644 --- a/Epub/KoeBook.Epub/Services/EpubGenerateService.cs +++ b/Epub/KoeBook.Epub/Services/EpubGenerateService.cs @@ -27,7 +27,8 @@ public async ValueTask GenerateEpubAsync(BookScripts bookScripts, string using var reader = new WaveFileReader(ms); var tmpMp3Path = Path.Combine(tempDirectory, $"{document.Title}{i}.mp3"); MediaFoundationEncoder.EncodeToMp3(reader, tmpMp3Path); - scriptLine.Audio = new Audio(reader.TotalTime, tmpMp3Path); + using var mp3Stream = new Mp3FileReader(tmpMp3Path); + scriptLine.Audio = new Audio(mp3Stream.TotalTime, tmpMp3Path); } if (await _createService.TryCreateEpubAsync(document, tempDirectory, cancellationToken).ConfigureAwait(false)) From 04f04ec7d03cac70a3438b695ee96646e64cca03 Mon Sep 17 00:00:00 2001 From: aiueo-1234 <130837816+aiueo-1234@users.noreply.github.com> Date: Fri, 3 May 2024 14:08:04 +0900 Subject: [PATCH 2/2] =?UTF-8?q?#54=20Claude=E3=81=8C=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=97=E3=83=AD=E3=83=B3=E3=83=97=E3=83=88?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E5=AF=BE=E5=87=A6=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KoeBook.Core/Services/ClaudeAnalyzerService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/KoeBook.Core/Services/ClaudeAnalyzerService.cs b/KoeBook.Core/Services/ClaudeAnalyzerService.cs index 3d1dd8a..ba072e2 100644 --- a/KoeBook.Core/Services/ClaudeAnalyzerService.cs +++ b/KoeBook.Core/Services/ClaudeAnalyzerService.cs @@ -174,10 +174,15 @@ private static (Character[], Dictionary) ExtractCharacterList(st var voiceIdLine = zippedLine.First.AsSpan(); voiceIdLine = voiceIdLine[(voiceIdLine.IndexOf(' ') + 2)..];//cまで無視 voiceIdLine = voiceIdLine[..voiceIdLine.IndexOf(' ')];// 二人以上話す時には先頭のものを使う + if (voiceIdLine[^1] == '.')// idに"."がつくことがあるので削除する + { + voiceIdLine = voiceIdLine[..^1]; + } if (characterId2Name.TryGetValue(voiceIdLine.ToString(), out var characterName)) { zippedLine.Second.Character = characterName; } + else { throw new EbookException(ExceptionType.ClaudeTalkerAndStyleSettingFailed); } return 0; }).Count(); if (voiceIdLinesCount != scriptLines.Length)