Skip to content

Conversation

@maiko3tattun
Copy link
Contributor

Improvements:

  • When loading voicebanks, setting an error and "oto.IsValid = false" for aliases if wav does not exist.
  • Improved singer's error report:
    sample rate, channels, and alias duplicates are now reported.
    image

@maiko3tattun
Copy link
Contributor Author

I'll have to modify the tests...

@maiko3tattun
Copy link
Contributor Author

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)) {
Copy link
Owner

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.

Copy link
Contributor Author

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;
Copy link
Owner

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

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);
}
}

Copy link
Contributor Author

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.

@maiko3tattun
Copy link
Contributor Author

Minor errors in error reports are separated as information.
This is because information such as missing character.yaml is misinterpreted as if it were a serious error.

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.
It is true that worldline should support a variety of sample rates, but that is a discussion for another place.

image

@stakira stakira merged commit 786c09a into stakira:master Nov 25, 2023
@maiko3tattun maiko3tattun deleted the 0923_WavCheck branch November 8, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants