public attachFileNameFromLyric ( string lyric ) : OtoArgs | ||
lyric | string | |
리턴 | OtoArgs |
public void readSubdirectoryOto() { var oto = new Oto(root_ + "/A/oto.ini", root_); var actual = oto.attachFileNameFromLyric("わ↑"); Assert.AreEqual("わ↑", actual.Alias); Assert.AreEqual(@"A\わ↑.wav", actual.fileName); }
/// <summary> /// 指定した歌詞に合致する、エイリアスを考慮した原音設定を取得します /// </summary> /// <param name="lyric"></param> /// <returns></returns> public OtoArgs attachFileNameFromLyric(string lyric, int note_number) { Func <string, OtoArgs> get_oto_arg = (l) => { var result = root_.attachFileNameFromLyric(l); if (!result.isEmpty()) { return(result); } foreach (var oto in sub_) { var args = oto.attachFileNameFromLyric(l); if (!args.isEmpty()) { return(args); } } return(new OtoArgs()); }; // first, try finding mapped lyric. if (prefixmap_ != null) { var mapped_lyric = prefixmap_.getMappedLyric(lyric, note_number); var args = get_oto_arg(mapped_lyric); if (!args.isEmpty()) { return(args); } } return(get_oto_arg(lyric)); }
public void readRootOto() { var oto = new Oto(root_ + "/oto.ini", root_); { var actual = oto.attachFileNameFromLyric("あ"); Assert.AreEqual("あ", actual.Alias); Assert.AreEqual("あ.wav", actual.fileName); Assert.AreEqual(6f, actual.msOffset); Assert.AreEqual(52f, actual.msConsonant); Assert.AreEqual(69f, actual.msBlank); Assert.AreEqual(1f, actual.msPreUtterance); Assert.AreEqual(2f, actual.msOverlap); } }