diff --git a/CloudBuilder.AI.Gui/AiBookOperationPage.Designer.cs b/CloudBuilder.AI.Gui/AiBookOperationPage.Designer.cs index 461cea2..930db77 100644 --- a/CloudBuilder.AI.Gui/AiBookOperationPage.Designer.cs +++ b/CloudBuilder.AI.Gui/AiBookOperationPage.Designer.cs @@ -61,8 +61,9 @@ namespace CloudBuilder.AI.Gui statusCol = new DataGridViewTextBoxColumn(); tabPage2 = new TabPage(); tableLayoutPanel7 = new TableLayoutPanel(); - kryptonDataGridView1 = new Krypton.Toolkit.KryptonDataGridView(); - kryptonDataGridView2 = new Krypton.Toolkit.KryptonDataGridView(); + bookPersonGv = new Krypton.Toolkit.KryptonDataGridView(); + bookPersonNameCol = new DataGridViewTextBoxColumn(); + bookActorNameCol = new DataGridViewComboBoxColumn(); tableLayoutPanel2 = new TableLayoutPanel(); statusCombo = new Krypton.Toolkit.KryptonComboBox(); guidLabel = new Krypton.Toolkit.KryptonLabel(); @@ -113,8 +114,7 @@ namespace CloudBuilder.AI.Gui ((System.ComponentModel.ISupportInitialize)dataGv).BeginInit(); tabPage2.SuspendLayout(); tableLayoutPanel7.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)kryptonDataGridView1).BeginInit(); - ((System.ComponentModel.ISupportInitialize)kryptonDataGridView2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)bookPersonGv).BeginInit(); tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)statusCombo).BeginInit(); processPanel.SuspendLayout(); @@ -415,34 +415,48 @@ namespace CloudBuilder.AI.Gui // // tableLayoutPanel7 // - tableLayoutPanel7.ColumnCount = 2; - tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); - tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); - tableLayoutPanel7.Controls.Add(kryptonDataGridView1, 0, 0); - tableLayoutPanel7.Controls.Add(kryptonDataGridView2, 1, 0); - tableLayoutPanel7.Location = new Point(76, 31); + tableLayoutPanel7.ColumnCount = 1; + tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); + tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F)); + tableLayoutPanel7.Controls.Add(bookPersonGv, 0, 0); + tableLayoutPanel7.Dock = DockStyle.Fill; + tableLayoutPanel7.Location = new Point(3, 3); tableLayoutPanel7.Name = "tableLayoutPanel7"; - tableLayoutPanel7.RowCount = 2; - tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 69.93671F)); - tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 30.0632915F)); - tableLayoutPanel7.Size = new Size(622, 316); + tableLayoutPanel7.RowCount = 1; + tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); + tableLayoutPanel7.Size = new Size(998, 392); tableLayoutPanel7.TabIndex = 0; // - // kryptonDataGridView1 + // bookPersonGv // - kryptonDataGridView1.BorderStyle = BorderStyle.None; - kryptonDataGridView1.Location = new Point(3, 3); - kryptonDataGridView1.Name = "kryptonDataGridView1"; - kryptonDataGridView1.Size = new Size(209, 173); - kryptonDataGridView1.TabIndex = 0; + bookPersonGv.AllowUserToAddRows = false; + bookPersonGv.AllowUserToDeleteRows = false; + bookPersonGv.BorderStyle = BorderStyle.None; + bookPersonGv.Columns.AddRange(new DataGridViewColumn[] { bookPersonNameCol, bookActorNameCol }); + bookPersonGv.Dock = DockStyle.Fill; + bookPersonGv.Location = new Point(3, 3); + bookPersonGv.Name = "bookPersonGv"; + bookPersonGv.Size = new Size(992, 386); + bookPersonGv.TabIndex = 0; // - // kryptonDataGridView2 + // bookPersonNameCol // - kryptonDataGridView2.BorderStyle = BorderStyle.None; - kryptonDataGridView2.Location = new Point(314, 3); - kryptonDataGridView2.Name = "kryptonDataGridView2"; - kryptonDataGridView2.Size = new Size(209, 173); - kryptonDataGridView2.TabIndex = 0; + bookPersonNameCol.DataPropertyName = "PersonName"; + bookPersonNameCol.HeaderText = "人名"; + bookPersonNameCol.Name = "bookPersonNameCol"; + bookPersonNameCol.Resizable = DataGridViewTriState.True; + bookPersonNameCol.Width = 200; + // + // bookActorNameCol + // + bookActorNameCol.DataPropertyName = "ActorName"; + bookActorNameCol.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; + bookActorNameCol.HeaderText = "配音"; + bookActorNameCol.Name = "bookActorNameCol"; + bookActorNameCol.Resizable = DataGridViewTriState.True; + bookActorNameCol.SortMode = DataGridViewColumnSortMode.Automatic; + bookActorNameCol.Width = 500; // // tableLayoutPanel2 // @@ -904,8 +918,7 @@ namespace CloudBuilder.AI.Gui ((System.ComponentModel.ISupportInitialize)dataGv).EndInit(); tabPage2.ResumeLayout(false); tableLayoutPanel7.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)kryptonDataGridView1).EndInit(); - ((System.ComponentModel.ISupportInitialize)kryptonDataGridView2).EndInit(); + ((System.ComponentModel.ISupportInitialize)bookPersonGv).EndInit(); tableLayoutPanel2.ResumeLayout(false); tableLayoutPanel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)statusCombo).EndInit(); @@ -975,8 +988,7 @@ namespace CloudBuilder.AI.Gui private TableLayoutPanel processPanel; private Krypton.Toolkit.KryptonButton extractNamesBut; private TableLayoutPanel tableLayoutPanel7; - private Krypton.Toolkit.KryptonDataGridView kryptonDataGridView1; - private Krypton.Toolkit.KryptonDataGridView kryptonDataGridView2; + private Krypton.Toolkit.KryptonDataGridView bookPersonGv; private TableLayoutPanel tableLayoutPanel6; private CloudBuilder.Gui.GridViewPagination gridViewPagination; private Krypton.Toolkit.KryptonDataGridView sentenceGv; @@ -992,5 +1004,7 @@ namespace CloudBuilder.AI.Gui private Krypton.Toolkit.KryptonDataGridViewTextBoxColumn sentimentCol; private Krypton.Toolkit.KryptonDataGridViewComboBoxColumn sentenceStatusCol; private Krypton.Toolkit.KryptonButton generaterMp3But; + private DataGridViewTextBoxColumn bookPersonNameCol; + private DataGridViewComboBoxColumn bookActorNameCol; } } diff --git a/CloudBuilder.AI.Gui/AiBookOperationPage.cs b/CloudBuilder.AI.Gui/AiBookOperationPage.cs index 77dcad7..6293f11 100644 --- a/CloudBuilder.AI.Gui/AiBookOperationPage.cs +++ b/CloudBuilder.AI.Gui/AiBookOperationPage.cs @@ -103,6 +103,7 @@ namespace CloudBuilder.AI.Gui private void InitComBox() { statusCombo.SetDataSource(bookStatusPolicy.GetDataSource(), true); + bookPersonGv.SetColumnDataSource(bookActorNameCol, SoVITSTtsVoicePolicy.GetInstance().GetComposeMessages(), true); } /// /// DataGridView分页控件初始化 @@ -132,9 +133,11 @@ namespace CloudBuilder.AI.Gui authorTxt.Set(AiBookEntity.AUTHOR); bookTypeTxt.Set(AiBookEntity.BOOK_TYPE); filePathTxt.Set(AiBookData.FILE_NAME, EnumEditModeColor.ReadOnly); + bookPersonNameCol.Set(EnumEditModeColor.ReadOnly); dataGv.InitColumn(false, false); sentenceGv.InitColumn(true, false); + bookPersonGv.InitColumn(true, false); guiOperateHelper = new GuiOperateHelper(); } @@ -285,6 +288,7 @@ namespace CloudBuilder.AI.Gui private void PackUIToEntity() { guiBindingContext.DataPack(); + data.AiBookPersons = bookPersonGv.GetUpdateRows(); } private bool SaveValidate() @@ -416,6 +420,7 @@ namespace CloudBuilder.AI.Gui private void PackEntityToUI() { guiBindingContext.DataBind(data.AiBook, this); + bookPersonGv.SetDataSource(data.AiBookPersons); filePathTxt.Text = data.FileName; @@ -752,7 +757,7 @@ namespace CloudBuilder.AI.Gui AiChapterEntity chapter = dataGv.GetRowData(dataGv.SelectedCells[0].RowIndex); - AiSentenceViewEntity[] aiSentences = aiSentenceRequest.FindByChapterId(chapter.ChapterId); + AiSentenceViewEntity[] aiSentences = aiSentenceRequest.FindByChapterId(chapter.BookId, chapter.ChapterId); sentenceGv.SetDataSource(aiSentences); } diff --git a/CloudBuilder.AI.Gui/AiBookOperationPage.resx b/CloudBuilder.AI.Gui/AiBookOperationPage.resx index 47338fa..f4ad0fa 100644 --- a/CloudBuilder.AI.Gui/AiBookOperationPage.resx +++ b/CloudBuilder.AI.Gui/AiBookOperationPage.resx @@ -135,6 +135,12 @@ True + + True + + + True + True diff --git a/CloudBuilder.AI.Service/AiBookService.auto.cs b/CloudBuilder.AI.Service/AiBookService.auto.cs index 5180f40..00bfb40 100644 --- a/CloudBuilder.AI.Service/AiBookService.auto.cs +++ b/CloudBuilder.AI.Service/AiBookService.auto.cs @@ -41,6 +41,9 @@ namespace CloudBuilder.AI.Service { AiBookData data = new AiBookData(); data.AiBook = repository.DetachedEntities.Where(x => x.BookId == key).FirstOrDefault()!; + IRepository repositoryAiBookPersonEntity = service.GetRepository>(); + + data.AiBookPersons = repositoryAiBookPersonEntity.DetachedEntities.Where(x => x.BookId == key).ToArray(); if (data.AiBook.FileId > 0) { @@ -156,6 +159,14 @@ namespace CloudBuilder.AI.Service repository.UpdateNow(aiBook); + if (data.AiBookPersons != null && data.AiBookPersons.Length > 0) + { + IRepository repositoryAiBookPersonEntity = service.GetRepository>(); + + repositoryAiBookPersonEntity.UpdateNow(data.AiBookPersons); + } + + return data; } @@ -240,7 +251,7 @@ namespace CloudBuilder.AI.Service repositoryAiChapterEntity.InsertNow(data.AiChapters); if (data.AiSentences == null || data.AiSentences.Count() == 0) return data; - repositoryAiSentenceEntity.InsertNow(data.AiSentences); + repositoryAiSentenceEntity.InsertNow(data.AiSentences); return FindByKey(key); } @@ -278,8 +289,8 @@ namespace CloudBuilder.AI.Service string save_path = Path.Combine(service.Configuration["FileServiceSettings:BackupDmsFileDirectory"], @"voice"); foreach (AiChapterEntity sentence in chapters) { - string param = PackTtsParameters(ChineseTtsVoice.Sherpa2.ToString(), save_path, sentence.BookId, sentence.ChapterId.ToString()); - RunMyProcess(service.Configuration["CloudBuilder.Topshelf:Path"], param); + string param = PackTtsParameters(save_path, sentence.BookId, sentence.ChapterId.ToString()); + RunMyProcessAsync(service.Configuration["CloudBuilder.Topshelf:Path"], param); } } @@ -293,8 +304,8 @@ namespace CloudBuilder.AI.Service string save_path = Path.Combine(service.Configuration["FileServiceSettings:BackupDmsFileDirectory"], @"voice"); foreach (AiChapterEntity sentence in chapters) { - string param = PackTtsParameters(ChineseTtsVoice.Sherpa2.ToString(), save_path, sentence.BookId, sentence.ChapterId.ToString()); - RunMyProcess(service.Configuration["CloudBuilder.Topshelf:Path"], param); + string param = PackTtsParameters(save_path, sentence.BookId, sentence.ChapterId.ToString()); + RunMyProcessAsync(service.Configuration["CloudBuilder.Topshelf:Path"], param); } } @@ -335,7 +346,7 @@ namespace CloudBuilder.AI.Service return para.ToArray().ToDelimiteredList(' '); } - private string PackTtsParameters(string voice, string save_path, string bookId, string chapterId) + private string PackTtsParameters(string save_path, string bookId, string chapterId) { //速度快,音质差 //task:TtsTask book_id:B000008 chapter_id:3 speed:1 voice:Sherpa2 actor:韩立 actor_voice:Sherpa1 save_path:D:\\Net8\\FileServer\\Backup\\DmsFile\\voice @@ -346,10 +357,10 @@ namespace CloudBuilder.AI.Service para.Add("task:" + "SoVITSTtsTask"); para.Add("book_id:" + bookId); para.Add("chapter_id:" + chapterId); - para.Add("voice:" + voice); + //para.Add("voice:" + voice); para.Add("save_path:" + save_path); - para.Add("speed:1"); - para.Add("actor:NA"); + //para.Add("speed:1"); + //para.Add("actor:NA"); return para.ToArray().ToDelimiteredList(' '); } diff --git a/CloudBuilder.AI.Service/AiSentenceService.auto.cs b/CloudBuilder.AI.Service/AiSentenceService.auto.cs index 3865a59..4807942 100644 --- a/CloudBuilder.AI.Service/AiSentenceService.auto.cs +++ b/CloudBuilder.AI.Service/AiSentenceService.auto.cs @@ -29,11 +29,11 @@ namespace CloudBuilder.AI.Service [PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Find)] - public AiSentenceViewEntity[] FindByChapterId(long chapterId) + public AiSentenceViewEntity[] FindByChapterId(string bookId, long chapterId) { IRepository repositoryAiSentenceViewEntity = repository.GetRepository>(); - return repositoryAiSentenceViewEntity.DetachedEntities.Where(x => x.ChapterId == chapterId).OrderBy(x => x.ParagraphId).ThenBy(x=>x.SentenceIndex).ToArray(); + return repositoryAiSentenceViewEntity.DetachedEntities.Where(x => x.BookId == bookId && x.ChapterId == chapterId).OrderBy(x => x.ParagraphId).ThenBy(x => x.SentenceIndex).ToArray(); } [PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Find)] diff --git a/CloudBuilder.AI/Entity/AiBookPersonEntity.auto.cs b/CloudBuilder.AI/Entity/AiBookPersonEntity.auto.cs index 18db6ed..3af6717 100644 --- a/CloudBuilder.AI/Entity/AiBookPersonEntity.auto.cs +++ b/CloudBuilder.AI/Entity/AiBookPersonEntity.auto.cs @@ -28,7 +28,7 @@ namespace CloudBuilder.AI.Entity [Column("book_id")] public string BookId { get; set; } [Column("person_name")] - public string PersonName { get; set; } + public string? PersonName { get; set; } [Column("actor_name")] public string? ActorName { get; set; } diff --git a/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy.cs b/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy.cs index e183d7f..b3d9534 100644 --- a/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy.cs +++ b/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy.cs @@ -1,4 +1,8 @@ -using System; +using CloudBuilder.Core.DependencyInjection.Form; +using CloudBuilder.Core.DependencyInjection.Policy; +using CloudBuilder.Core.DependencyInjection.Request; +using Microsoft.Extensions.DependencyInjection; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -102,4 +106,76 @@ namespace CloudBuilder.AI.Policy FEMALE_CHILD4, } + public class SoVITSTtsVoicePolicy : AbstractPolicy, IPolicy + { + + public const string OLD_MAN1 = "OLD_MAN1"; + public const string OLD_MAN2 = "OLD_MAN2"; + public const string OLD_MAN3 = "OLD_MAN3"; + public const string OLD_MAN4 = "OLD_MAN4"; + public const string OLD_MAN5 = "OLD_MAN5"; + public const string OLD_MAN6 = "OLD_MAN6"; + public const string OLD_MAN7 = "OLD_MAN7"; + public const string MIDDLE_AGED_MAN1 = "MIDDLE_AGED_MAN1"; + public const string MIDDLE_AGED_MAN2 = "MIDDLE_AGED_MAN2"; + public const string MIDDLE_AGED_MAN3 = "MIDDLE_AGED_MAN3"; + public const string MIDDLE_AGED_MAN4 = "MIDDLE_AGED_MAN4"; + public const string MIDDLE_AGED_MAN5 = "MIDDLE_AGED_MAN5"; + public const string MIDDLE_AGED_MAN6 = "MIDDLE_AGED_MAN6"; + public const string MIDDLE_AGED_MAN7 = "MIDDLE_AGED_MAN7"; + public const string YOUNG_MALE1 = "YOUNG_MALE1"; + public const string YOUNG_MALE2 = "YOUNG_MALE2"; + public const string YOUNG_MALE3 = "YOUNG_MALE3"; + public const string YOUNG_MALE4 = "YOUNG_MALE4"; + public const string YOUNG_MALE5 = "YOUNG_MALE5"; + public const string YOUNG_MALE6 = "YOUNG_MALE6"; + public const string YOUNG_MALE7 = "YOUNG_MALE7"; + public const string MALE_CHILD1 = "MALE_CHILD1"; + public const string MALE_CHILD2 = "MALE_CHILD2"; + public const string MALE_CHILD3 = "MALE_CHILD3"; + public const string MALE_CHILD4 = "MALE_CHILD4"; + public const string ELDERLY_FEMALE1 = "ELDERLY_FEMALE1"; + public const string ELDERLY_FEMALE2 = "ELDERLY_FEMALE2"; + public const string ELDERLY_FEMALE3 = "ELDERLY_FEMALE3"; + public const string MIDDLE_AGED_FEMALE1 = "MIDDLE_AGED_FEMALE1"; + public const string MIDDLE_AGED_FEMALE2 = "MIDDLE_AGED_FEMALE2"; + public const string MIDDLE_AGED_FEMALE3 = "MIDDLE_AGED_FEMALE3"; + public const string MIDDLE_AGED_FEMALE4 = "MIDDLE_AGED_FEMALE4"; + public const string MIDDLE_AGED_FEMALE5 = "MIDDLE_AGED_FEMALE5"; + public const string MIDDLE_AGED_FEMALE6 = "MIDDLE_AGED_FEMALE6"; + public const string MIDDLE_AGED_FEMALE7 = "MIDDLE_AGED_FEMALE7"; + public const string YOUNG_FEMALE1 = "YOUNG_FEMALE1"; + public const string YOUNG_FEMALE2 = "YOUNG_FEMALE2"; + public const string YOUNG_FEMALE3 = "YOUNG_FEMALE3"; + public const string YOUNG_FEMALE4 = "YOUNG_FEMALE4"; + public const string YOUNG_FEMALE5 = "YOUNG_FEMALE5"; + public const string YOUNG_FEMALE6 = "YOUNG_FEMALE6"; + public const string YOUNG_FEMALE7 = "YOUNG_FEMALE7"; + public const string FEMALE_CHILD1 = "FEMALE_CHILD1"; + public const string FEMALE_CHILD2 = "FEMALE_CHILD2"; + public const string FEMALE_CHILD3 = "FEMALE_CHILD3"; + public const string FEMALE_CHILD4 = "FEMALE_CHILD4"; + + public static SoVITSTtsVoicePolicy instance = null; + + public SoVITSTtsVoicePolicy(IContext context) : base(context) + { + this.values = new string[] { + OLD_MAN1, OLD_MAN2, OLD_MAN3, OLD_MAN4, OLD_MAN5, OLD_MAN6, OLD_MAN7, + MIDDLE_AGED_MAN1,MIDDLE_AGED_MAN2,MIDDLE_AGED_MAN3,MIDDLE_AGED_MAN4,MIDDLE_AGED_MAN5,MIDDLE_AGED_MAN6, + YOUNG_MALE1,YOUNG_MALE2,YOUNG_MALE3,YOUNG_MALE4,YOUNG_MALE5,YOUNG_MALE6,YOUNG_MALE7, + MALE_CHILD1,MALE_CHILD2,MALE_CHILD3,MALE_CHILD4, + ELDERLY_FEMALE1,ELDERLY_FEMALE2,ELDERLY_FEMALE3, + MIDDLE_AGED_FEMALE1,MIDDLE_AGED_FEMALE2,MIDDLE_AGED_FEMALE3,MIDDLE_AGED_FEMALE4,MIDDLE_AGED_FEMALE5,MIDDLE_AGED_FEMALE6,MIDDLE_AGED_FEMALE7, + YOUNG_FEMALE1,YOUNG_FEMALE2,YOUNG_FEMALE3,YOUNG_FEMALE4,YOUNG_FEMALE5,YOUNG_FEMALE6,YOUNG_FEMALE7, + FEMALE_CHILD1,FEMALE_CHILD2,FEMALE_CHILD3,FEMALE_CHILD4}; + } + + public static SoVITSTtsVoicePolicy GetInstance() + { + instance = ApplicationServiceContext.ServiceProvider.GetKeyedService(typeof(SoVITSTtsVoicePolicy).Name); + return instance; + } + } + } diff --git a/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy_en.resx b/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy_en.resx new file mode 100644 index 0000000..94e6679 --- /dev/null +++ b/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy_en.resx @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 老年人(女性)1 音质好 + + + 老年人(女性)2 + + + 老年人(女性)3 音质好 + + + 女儿童(女性)1 音质好 + + + 女儿童(女性)2 + + + 女儿童(女性)3 + + + 女儿童(女性)4 音质好 + + + 男儿童(男性)1 音质好 + + + 男儿童(男性)2 + + + 男儿童(男性)3 音质好 + + + 男儿童(男性)4 + + + 女中年(女性)1 + + + 女中年(女性)2 + + + 女中年(女性)3 音质好 + + + 女中年(女性)4 + + + 女中年(女性)5 音质好 + + + 女中年(女性)6 + + + 女中年(女性)7 + + + 男中年(男性)1 + + + 男中年(男性)2 + + + 男中年(男性)3 音质好 + + + 男中年(男性)4 + + + 男中年(男性)5 音质好 + + + 男中年(男性)6 + + + 男中年(男性)7 音质好 + + + 老年人(男性)1 + + + 老年人(男性)2 音质好 + + + 老年人(男性)3 + + + 老年人(男性)4 + + + 老年人(男性)5 音质好 + + + 老年人(男性)6 + + + 老年人(男性)7 + + + 女青年(女性)1 音质好 + + + 女青年(女性)2 + + + 女青年(女性)3 + + + 女青年(女性)4 + + + 女青年(女性)5 + + + 女青年(女性)6 + + + 女青年(女性)7 音质好 + + + 男青年(男性)1 + + + 男青年(男性)2 音质好 + + + 男青年(男性)3 + + + 男青年(男性)4 + + + 男青年(男性)5 + + + 男青年(男性)6 + + + 男青年(男性)7 音质好 + + \ No newline at end of file diff --git a/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy_zh-cn.resx b/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy_zh-cn.resx new file mode 100644 index 0000000..94e6679 --- /dev/null +++ b/CloudBuilder.AI/Policy/SoVITSTtsVoicePolicy_zh-cn.resx @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 老年人(女性)1 音质好 + + + 老年人(女性)2 + + + 老年人(女性)3 音质好 + + + 女儿童(女性)1 音质好 + + + 女儿童(女性)2 + + + 女儿童(女性)3 + + + 女儿童(女性)4 音质好 + + + 男儿童(男性)1 音质好 + + + 男儿童(男性)2 + + + 男儿童(男性)3 音质好 + + + 男儿童(男性)4 + + + 女中年(女性)1 + + + 女中年(女性)2 + + + 女中年(女性)3 音质好 + + + 女中年(女性)4 + + + 女中年(女性)5 音质好 + + + 女中年(女性)6 + + + 女中年(女性)7 + + + 男中年(男性)1 + + + 男中年(男性)2 + + + 男中年(男性)3 音质好 + + + 男中年(男性)4 + + + 男中年(男性)5 音质好 + + + 男中年(男性)6 + + + 男中年(男性)7 音质好 + + + 老年人(男性)1 + + + 老年人(男性)2 音质好 + + + 老年人(男性)3 + + + 老年人(男性)4 + + + 老年人(男性)5 音质好 + + + 老年人(男性)6 + + + 老年人(男性)7 + + + 女青年(女性)1 音质好 + + + 女青年(女性)2 + + + 女青年(女性)3 + + + 女青年(女性)4 + + + 女青年(女性)5 + + + 女青年(女性)6 + + + 女青年(女性)7 音质好 + + + 男青年(男性)1 + + + 男青年(男性)2 音质好 + + + 男青年(男性)3 + + + 男青年(男性)4 + + + 男青年(男性)5 + + + 男青年(男性)6 + + + 男青年(男性)7 音质好 + + \ No newline at end of file diff --git a/CloudBuilder.AI/Service/IAiSentenceService.auto.cs b/CloudBuilder.AI/Service/IAiSentenceService.auto.cs index 6c7ef7e..abce0f0 100644 --- a/CloudBuilder.AI/Service/IAiSentenceService.auto.cs +++ b/CloudBuilder.AI/Service/IAiSentenceService.auto.cs @@ -6,9 +6,9 @@ using CloudBuilder.Core.Service; namespace CloudBuilder.AI.Service { - public interface IAiSentenceService :IServiceBase + public interface IAiSentenceService : IServiceBase { - AiSentenceViewEntity[] FindByChapterId(long chapterId); + AiSentenceViewEntity[] FindByChapterId(string bookId, long chapterId); AiSentenceViewResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria); void Inserts(AiSentenceEntity[] datas); } diff --git a/CloudBuilder.Request/AI/AiSentenceRequest.auto.cs b/CloudBuilder.Request/AI/AiSentenceRequest.auto.cs index dbf3979..4ef66a3 100644 --- a/CloudBuilder.Request/AI/AiSentenceRequest.auto.cs +++ b/CloudBuilder.Request/AI/AiSentenceRequest.auto.cs @@ -1,57 +1,63 @@ -using CloudBuilder.Core.DependencyInjection.Request; -using CloudBuilder.Core.Request; -using CloudBuilder.Core.Service; -using Microsoft.Extensions.DependencyInjection; -using CloudBuilder.AI.Service; - using CloudBuilder.Core.DatabaseAccessor.Entity; - using CloudBuilder.AI.Data; - using System; - using CloudBuilder.AI.Entity; - using CloudBuilder.AI.SearchCriteria; - using Microsoft.AspNetCore.Mvc; - using CloudBuilder.AI; - -namespace CloudBuilder.Request.AI -{ - -public class AiSentenceRequest : IRequest -{ - -private readonly IServiceRequest serviceRequest; -public AiSentenceRequest(IServiceRequest serviceRequest) -{ -this.serviceRequest = serviceRequest; -} - - public AiSentenceEntity FindByKey(Int64 key) - { -return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); } - - public AiSentenceViewEntity[] FindByChapterId(Int64 chapterId) - { -return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/FindByChapterId?chapterId=" + chapterId.ToString())).GetAwaiter().GetResult(); } - - public AiSentenceViewResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria) - { -return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); } - - public AiSentenceEntity Insert(AiSentenceEntity data) - { -return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/Insert" , data)).GetAwaiter().GetResult(); } - - public void Inserts(AiSentenceEntity[] datas) - { - Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/Inserts" , datas)).GetAwaiter().GetResult(); } - - public AiSentenceEntity Update(AiSentenceEntity data) - { -return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/Update" , data)).GetAwaiter().GetResult(); } - - public void Delete(Int64 key) - { - Task.Run(() => serviceRequest.PostAsync("/AiSentence/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); } - - -} +using CloudBuilder.Core.DependencyInjection.Request; +using CloudBuilder.Core.Request; +using CloudBuilder.Core.Service; +using Microsoft.Extensions.DependencyInjection; +using CloudBuilder.AI.Service; + using CloudBuilder.Core.DatabaseAccessor.Entity; + using CloudBuilder.AI.Data; + using System; + using CloudBuilder.AI.Entity; + using CloudBuilder.AI.SearchCriteria; + using Microsoft.AspNetCore.Mvc; + using CloudBuilder.AI; + +namespace CloudBuilder.Request.AI +{ + +public class AiSentenceRequest : IRequest +{ + +private readonly IServiceRequest serviceRequest; +public AiSentenceRequest(IServiceRequest serviceRequest) +{ +this.serviceRequest = serviceRequest; +} + + public AiSentenceEntity FindByKey(Int64 key) + { +return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); } + + + public class FindByChapterIdCompositionData2 { + public string bookId { get; set; } + public Int64 chapterId { get; set; } + + } + public AiSentenceViewEntity[] FindByChapterId(string bookId, Int64 chapterId) + { +var compositionData = new FindByChapterIdCompositionData2{ bookId = bookId, chapterId = chapterId }; return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/FindByChapterId", compositionData)).GetAwaiter().GetResult(); } + + public AiSentenceViewResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria) + { +return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); } + + public AiSentenceEntity Insert(AiSentenceEntity data) + { +return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/Insert" , data)).GetAwaiter().GetResult(); } + + public void Inserts(AiSentenceEntity[] datas) + { + Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/Inserts" , datas)).GetAwaiter().GetResult(); } + + public AiSentenceEntity Update(AiSentenceEntity data) + { +return Task.Run(() => serviceRequest.PostAsJsonAsync("/AiSentence/Update" , data)).GetAwaiter().GetResult(); } + + public void Delete(Int64 key) + { + Task.Run(() => serviceRequest.PostAsync("/AiSentence/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); } + + +} } \ No newline at end of file diff --git a/CloudBuilder.Web.Entry/CloudBuilder.Web.Entry.csproj.user b/CloudBuilder.Web.Entry/CloudBuilder.Web.Entry.csproj.user index 7ed6f9b..d1180d8 100644 --- a/CloudBuilder.Web.Entry/CloudBuilder.Web.Entry.csproj.user +++ b/CloudBuilder.Web.Entry/CloudBuilder.Web.Entry.csproj.user @@ -1,6 +1,6 @@  - D:\NET8\CloudBuilder\CloudBuilder.Web.Entry\Properties\PublishProfiles\FolderProfile.pubxml + D:\MAFAI\CloudBuilder\CloudBuilder.Web.Entry\Properties\PublishProfiles\FolderProfile1.pubxml \ No newline at end of file diff --git a/CloudBuilder.Web.Entry/Controllers/Ai/AiSentenceController.auto.cs b/CloudBuilder.Web.Entry/Controllers/Ai/AiSentenceController.auto.cs index d002719..ea8bc56 100644 --- a/CloudBuilder.Web.Entry/Controllers/Ai/AiSentenceController.auto.cs +++ b/CloudBuilder.Web.Entry/Controllers/Ai/AiSentenceController.auto.cs @@ -50,14 +50,21 @@ this.aiSentenceService= aiSentenceService; } } + + public class FindByChapterIdCompositionData + { + public string bookId { get; set; } + public Int64 chapterId { get; set; } + + } [PermissionOperate(name: "AiBook", operate: "Find")] [HttpPost] - public dynamic FindByChapterId(Int64 chapterId) + public dynamic FindByChapterId(FindByChapterIdCompositionData compositionData) { try { - var result = aiSentenceService.FindByChapterId(chapterId); + var result = aiSentenceService.FindByChapterId(compositionData.bookId,compositionData.chapterId); return result; } catch (ValidatedException vex) diff --git a/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile1.pubxml b/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile1.pubxml new file mode 100644 index 0000000..3b6594f --- /dev/null +++ b/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile1.pubxml @@ -0,0 +1,15 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + C:\inetpub\wwwroot\webapi + FileSystem + <_TargetId>Folder + + \ No newline at end of file diff --git a/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile1.pubxml.user b/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile1.pubxml.user new file mode 100644 index 0000000..2183105 --- /dev/null +++ b/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -0,0 +1,9 @@ + + + + + <_PublishTargetUrl>C:\inetpub\wwwroot\webapi + True|2026-06-23T02:11:00.8522806Z||; + + + \ No newline at end of file