2 Star 7 Fork 2

Enious / Zimu2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

一个简单小工具。转换微软虚拟学院(MVA)XML字幕为SRT字幕

基本功能:

  1. 支持拖拽TXT或者XML文件到APP中。

  2. 最终把添加的文件转换为SRT格式字幕。

  3. 批量转换等。

项目状态:停止

APP下载:请到附件中下载(下面有链接)

  1. 安装安全证书
  2. 安装应用程序

更新(2016年8月12日22:05:01)

支持到一周年更新版系统(14393)和.NET Native 解决了字幕中出现负数时间轴而导致的字幕问题。

已知BUG:2次拖入了同名文件导致BUG问题,下个版本添加判断。

如果出现00:00:21.626格式的字幕时间轴会无法获取到值,需要更改判断条件。

更新(2016年8月9日18:29:08)

解决拖入UTF8编码的XML文件闪退问题

更新(2016年7月30日18:03:17)

已知BUG状态栏无法正常显示。

利用XmlDocument类读取XML字幕文件

1.创建一个model有:开始、结束时间和字幕文本3个属性

private class SumString
{
   public string begin { get; set; }
   public string end { get; set; }
   public string text { get; set; }
}

2.创建3个List来保存:开始、结束和字幕文本。

List<String> beginAttribute = new List<String>();//开始时间
List<String> endAttribute = new List<String>();//结束时间
List<String> text = new List<string>();//节点文本类容

3.读取XML:保存到beginAttribute、endAttribute和text。

由于UWPEncoding.GetEncoding()没有GB2312所以必须自己手动注册

#region 注册GB2312
EncodingProvider provider = CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider(provider);
Encoding gb2312 = Encoding.GetEncoding("gb2312");
#endregion

#region 注册GB2312
EncodingProvider provider = CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider( provider );
Encoding gb2312 = Encoding.GetEncoding( "gb2312" );
#endregion

var content = File.ReadAllText( path, gb2312 );

byte[]	tempG	= gb2312.GetBytes( content );
byte[]	utf8	= Encoding.Convert( gb2312, Encoding.UTF8, tempG );
string	utf8str = Encoding.UTF8.GetString( utf8 );


XmlDocument document = new XmlDocument();
document.LoadXml( utf8str );
var templist = document.GetElementsByTagName( "p" );
foreach ( XmlNode p in templist )
{
	beginAttribute.Add( p.Attributes["begin"].Value );
	endAttribute.Add( p.Attributes["end"].Value );
	text.Add( p.InnerText.Trim() );
}

更新(2016年7月28日00:42:38)

1.基本布局和一些动画的练习。

输入图片说明

The MIT License (MIT) Copyright (c) 2016 Enious Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

微软虚拟学院视频字幕转换 XML字幕转SRT 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/Enious/Zimu2.git
git@gitee.com:Enious/Zimu2.git
Enious
Zimu2
Zimu2
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891