Fix sustained vowel closed-mouth bug for EN locales

This commit is contained in:
James S 2024-05-19 17:49:41 -07:00
parent 9b7b928a26
commit c74b0b97e0

View File

@ -56,6 +56,9 @@ namespace LipSync {
[OptionalField] [OptionalField]
private bool m_position_fixed = false; private bool m_position_fixed = false;
// Slightly different characters used in EN/JP locales for sustaining a vowel note
private static List<string> m_list_hyphen = new List<string>(new string[] { "ー", "-" });
public Size ImageSize { public Size ImageSize {
get { get {
if ( m_character3 != null ) { if ( m_character3 != null ) {
@ -161,7 +164,7 @@ namespace LipSync {
lyric = spl[0].Replace( " ", "" ); lyric = spl[0].Replace( " ", "" );
VowelType type = VowelType.Attach( lyric ); VowelType type = VowelType.Attach( lyric );
if ( entry > 0 && lyric == "ー" ) { if ( entry > 0 && m_list_hyphen.Contains(lyric) ) {
type = last_vowel; type = last_vowel;
} }
if ( phonetics == "br1" || phonetics == "br2" || phonetics == "br3" || phonetics == "br4" || phonetics == "br5" ) { if ( phonetics == "br1" || phonetics == "br2" || phonetics == "br3" || phonetics == "br4" || phonetics == "br5" ) {
@ -366,7 +369,7 @@ namespace LipSync {
bool mode_sp = false; bool mode_sp = false;
if ( close_mouth_when_same_vowel_repeated ) { if ( close_mouth_when_same_vowel_repeated ) {
// 母音が連続する場合を検出 // 母音が連続する場合を検出
if ( separate == "" && begin == last_end && last_vowel.Equals( type ) && lyric != "ー" ) { if ( separate == "" && begin == last_end && last_vowel.Equals( type ) && !m_list_hyphen.Contains(lyric) ) {
if ( type.Equals( VowelType.a ) ) { if ( type.Equals( VowelType.a ) ) {
if ( lyric != "あ" && !phonetics.StartsWith( "a" ) ) { if ( lyric != "あ" && !phonetics.StartsWith( "a" ) ) {
separate = "nn"; separate = "nn";