-
Notifications
You must be signed in to change notification settings - Fork 425
Fix voicebank error check #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'll have to modify the tests... |
|
I had to write dirty code to pass the tests ; ; |
| } | ||
| if (!IsTest) { | ||
| string path = Path.Combine(Path.GetDirectoryName(trace.file), oto.Wav); | ||
| if (!File.Exists(path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's wasteful to check for every oto line. It would be better to parse all lines first, then check files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it.
| try { | ||
| using (var wav = Core.Format.Wave.OpenFile(filePath)) { | ||
| fileDuration = wav.TotalTime.TotalMilliseconds; | ||
| var waveFormat = wav.ToSampleProvider().WaveFormat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative, conversion can be done like how non-wav files are handled. See
OpenUtau/OpenUtau.Core/Classic/VoicebankFiles.cs
Lines 83 to 93 in 05076e4
| if (Path.GetExtension(source) == ".wav") { | |
| Log.Verbose($"Copy {source} to {dest}"); | |
| File.Copy(source, dest); | |
| return; | |
| } | |
| Log.Verbose($"Decode {source} to {dest}"); | |
| using (var outputStream = new FileStream(dest, FileMode.Create)) { | |
| using (var waveStream = Core.Format.Wave.OpenFile(source)) { | |
| WaveFileWriter.WriteWavFileToStream(outputStream, waveStream); | |
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an error report and should be reported down to the smallest detail.
In fact, the current worldline will not play correctly if the sample rate is incorrect. There is also a possibility that voicebanks created by OU could be distributed and used by OG UTAU.
|
Minor errors in error reports are separated as information. Currently, stereo files that are supported by worldline are reported as information, not 44100 Hz files that are not supported by worldline are reported as errors. |

Improvements:
sample rate, channels, and alias duplicates are now reported.