admin管理员组文章数量:1124549
var lyricTimedEvents = midiFile.GetTimedEvents().Where(e => e.Event.EventType == MidiEventType.Lyric);
Console.WriteLine($"{z} timed events found.");
foreach (var e in lyricTimedEvents)
{
var metricTime = e.TimeAs<MetricTimeSpan>(tempoMap);
var lyricText = ((LyricEvent)e.Event).Text;
Console.Write($@"
[{metricTime:mm\:ss\.fff}]{lyricText}");
}
//output looks like this [hours:minutes:seconds:miliseconds] or [00:01:12:123]
tempoMap = midiFile.GetTempoMap();
TimeSpan midiFileDuration = midiFile.GetDuration<MetricTimeSpan>();
Console.WriteLine($" Midi File duration [ {SONG} ] = {midiFileDuration}");
Console.ReadKey();
foreach (var chord in midiFile.GetChords())
{
var timeSpan = (TimeSpan)chord.TimeAs<MetricTimeSpan>(tempoMap);
Console.Write($@"
[{timeSpan:mm\:ss\.fff}]{chord}");
}
// Output look [min:sec.milisec] or [00:02.122] I need this format for time in lyrics // How I can get it ? I need one dot before miliseconds
本文标签: cHow I can get specific time format for lyrics event DryWetMidi libraryStack Overflow
版权声明:本文标题:c# - How I can get specific time format for lyrics event DryWetMidi library - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736639133a1945953.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论