Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions OpenUtau.Core/Classic/VoicebankErrorChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public void Check() {
}
if (fileDuration <= 0) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
soundFile = filePath,
messageKey = "singererror.invalidduration",
strings = new string[] { fileDuration.ToString() }
Expand Down Expand Up @@ -120,29 +119,25 @@ bool TryGetFileDuration(string filePath, Oto oto, out double fileDuration) {
var waveFormat = wav.ToSampleProvider().WaveFormat;
if (waveFormat.SampleRate != 44100) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
soundFile = filePath,
messageKey = "singererror.samplerate"
});
}
if (waveFormat.Channels != 1) {
Infos.Add(new VoicebankError() {
trace = oto.FileTrace,
soundFile = filePath,
messageKey = "singererror.mono"
});
}
if (waveFormat.BitsPerSample != 16) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
soundFile = filePath,
messageKey = "singererror.bitdepth"
});
}
}
} catch (Exception e) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
soundFile = filePath,
messageKey = "singererror.soundnotopened",
e = e,
Expand All @@ -165,8 +160,7 @@ bool CheckOto(Oto oto, double fileDuration) {
if (oto.Offset > fileDuration) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
messageKey = "singererror.offsetoutofduration",
strings = new string[] { fileDuration.ToString() }
messageKey = "singererror.offsetoutofduration"
});
valid = false;
}
Expand All @@ -180,8 +174,7 @@ bool CheckOto(Oto oto, double fileDuration) {
if (oto.Preutter + oto.Offset > fileDuration) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
messageKey = "singererror.preutteroutofduration",
strings = new string[] { fileDuration.ToString() }
messageKey = "singererror.preutteroutofduration"
});
valid = false;
}
Expand All @@ -195,16 +188,14 @@ bool CheckOto(Oto oto, double fileDuration) {
if (oto.Consonant + oto.Offset > fileDuration) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
messageKey = "singererror.consonantoutofduration",
strings = new string[] { fileDuration.ToString() }
messageKey = "singererror.consonantoutofduration"
});
valid = false;
}
if (oto.Overlap + oto.Offset > fileDuration) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
messageKey = "singererror.overlapoutofduration",
strings = new string[] { fileDuration.ToString() }
messageKey = "singererror.overlapoutofduration"
});
valid = false;
}
Expand All @@ -230,6 +221,13 @@ bool CheckOto(Oto oto, double fileDuration) {
});
valid = false;
}
if (cutoff > fileDuration) {
Errors.Add(new VoicebankError() {
trace = oto.FileTrace,
messageKey = "singererror.cutoffoutofduration"
});
valid = false;
}

if (oto.Alias.StartsWith(" ") || oto.Alias.EndsWith(" ")) {
Infos.Add(new VoicebankError() {
Expand Down
9 changes: 5 additions & 4 deletions OpenUtau/Strings/Strings.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,10 @@ Warning: this option removes custom presets.</system:String>
<system:String x:Key="singererror.aliasmultiplespaces">Alias contains multiple spaces.</system:String>
<system:String x:Key="singererror.aliasstartwithspace">Alias starts or ends with a space.</system:String>
<system:String x:Key="singererror.bitdepth">Bit depth of the sound file is not 16bit.</system:String>
<system:String x:Key="singererror.consonantoutofduration">Consonant out of sound file duration {fileDuration}.</system:String>
<system:String x:Key="singererror.consonantoutofduration">Consonant out of sound file duration.</system:String>
<system:String x:Key="singererror.consonantshort">Consonant must be >= 0.</system:String>
<system:String x:Key="singererror.cutoffconsonant">Cutoff must be to the right of consonant.</system:String>
<system:String x:Key="singererror.cutoffoutofduration">Cutoff out of sound file duration.</system:String>
<system:String x:Key="singererror.cutoffoverlap">Cutoff must be to the right of overlap.</system:String>
<system:String x:Key="singererror.cutoffpreutter">Cutoff must be to the right of preutter.</system:String>
<system:String x:Key="singererror.duplicatealias">There are duplicate aliases.{0}</system:String>
Expand All @@ -506,10 +507,10 @@ The voicebank may not work on another OS with case-sensitivity.</system:String>
<system:String x:Key="singererror.invalidduration">Invalid duration {0}.</system:String>
<system:String x:Key="singererror.invalidoto">Invalid oto format.</system:String>
<system:String x:Key="singererror.mono">Sound file is not mono channel.</system:String>
<system:String x:Key="singererror.offsetoutofduration">Offset out of sound file duration {fileDuration}.</system:String>
<system:String x:Key="singererror.offsetoutofduration">Offset out of sound file duration.</system:String>
<system:String x:Key="singererror.offsetshort">Offset must be >= 0.</system:String>
<system:String x:Key="singererror.overlapoutofduration">Overlap out of sound file duration {fileDuration}.</system:String>
<system:String x:Key="singererror.preutteroutofduration">Preutter out of sound file duration {fileDuration}.</system:String>
<system:String x:Key="singererror.overlapoutofduration">Overlap out of sound file duration.</system:String>
<system:String x:Key="singererror.preutteroutofduration">Preutter out of sound file duration.</system:String>
<system:String x:Key="singererror.preuttershort">Preutter must be >= 0.</system:String>
<system:String x:Key="singererror.samplerate">Sample rate of the sound file is not 44100Hz.</system:String>
<system:String x:Key="singererror.soundmissing">Sound file missing</system:String>
Expand Down
Loading