Skip to content

Commit 2039f34

Browse files
authored
Merge pull request #1278 from oxygen-dioxide/diffsinger
diffsinger phonemizers: error in one sentence won't affect the following sentences
2 parents 3c2f4bc + ff8b8f4 commit 2039f34

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

OpenUtau.Core/MachineLearningPhonemizer.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using OpenUtau.Api;
55
using OpenUtau.Core.Ustx;
6+
using Serilog;
67

78
namespace OpenUtau.Core {
89
public abstract class MachineLearningPhonemizer : Phonemizer
@@ -30,7 +31,12 @@ public override void SetUp(Note[][] groups, UProject project, UTrack track) {
3031
phrase.Add(groups[i]);
3132
} else {
3233
//If the previous and current notes are not connected, process the current sentence and start the next sentence
33-
ProcessPart(phrase.ToArray());
34+
try{
35+
ProcessPart(phrase.ToArray());
36+
}catch(Exception e){
37+
var sentenceLyrics = string.Join(" ", phrase.Select(group => group[0].lyric));
38+
Log.Error($"Failed to phonemize sentence {sentenceLyrics}: {e.Message}");
39+
}
3440
phrase.Clear();
3541
phrase.Add(groups[i]);
3642
}

0 commit comments

Comments
 (0)