Learn.VideoAnalysis/VideoAnalysisCore/Model/Dto/SpeakerCaptionsDto.cs

74 lines
2.0 KiB
C#

using AntDesign;
using VideoAnalysisCore.AICore.GPT.Dto;
using VideoAnalysisCore.Enum;
namespace VideoAnalysisCore.Model.Dto
{
/// <summary>
/// 时间线
/// </summary>
public class TimeBase
{
/// <summary>
///
/// </summary>
/// <param name="str">时间端字符串</param>
/// <param name="content">内容</param>
public TimeBase(string str, string content)
{
Content = content;
if (string.IsNullOrEmpty(str))
return;
var arr = str.Split(":");
if (arr !=null && arr.Length >= 3)
{
Start = float.Parse(arr[1]);
End = float.Parse(arr[2]);
}
}
public TimeBase()
{
}
/// <summary>
/// 开始时间
/// </summary>
public float Start { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public float End { get; set; }
/// <summary>
/// 内容
/// </summary>
public string? Content { get; set; }
/// <summary>
/// 时间段 类型
/// <para><see cref="TaskRes.TimeOverview"/> 时为 null</para>
/// </summary>
public TimeBaseTypeEnum? TimeBaseType { get; set; }
}
public class TotalCaptionsDto
{
/// <summary>
/// 拼接说话人后的最终字幕
/// </summary>
public string Captions { get; set; } = string.Empty;
/// <summary>
/// 教师发言时间
/// <para>秒</para>
/// </summary>
public decimal TeacherSpeaking { get; set; } = 0;
/// <summary>
/// 学生发言时间
/// <para>秒</para>
/// </summary>
public decimal StudentSpeaking { get; set; } = 0;
/// <summary>
/// 视频时间轴
/// </summary>
public IEnumerable<TimeBase>? TimeBase { get; set; }
}
}