Skip to content

Commit

Permalink
support using worldline resampler together with external wavtools
Browse files Browse the repository at this point in the history
  • Loading branch information
oxygen-dioxide committed Dec 12, 2023
1 parent f23b171 commit 95c3d61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 9 additions & 0 deletions OpenUtau.Core/Classic/ExeWavtool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ public float[] Concatenate(List<ResamplerItem> resamplerItems, string tempPath,
if (cancellation.IsCancellationRequested) {
return null;
}
//The builtin worldline resampler can't be called from bat script,
//so we need to call it directly from C#
foreach(var item in resamplerItems){
if(!(item.resampler is ExeResampler) && !cancellation.IsCancellationRequested && !File.Exists(item.outputFile)){
lock (Renderers.GetCacheLock(item.outputFile)) {
item.resampler.DoResamplerReturnsFile(item, Log.Logger);
}
}
}
PrepareHelper();
string batPath = Path.Combine(PathManager.Inst.CachePath, "temp.bat");
lock (tempBatLock) {
Expand Down
8 changes: 1 addition & 7 deletions OpenUtau.Core/Render/Renderers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,7 @@ public static IReadOnlyList<IResampler> GetSupportedResamplers(IWavtool? wavtool
}

public static IReadOnlyList<IWavtool> GetSupportedWavtools(IResampler? resampler) {
if (resampler is WorldlineResampler) {
return ToolsManager.Inst.Wavtools
.Where(r => r is SharpWavtool)
.ToArray();
} else {
return ToolsManager.Inst.Wavtools;
}
return ToolsManager.Inst.Wavtools;
}
}
}

0 comments on commit 95c3d61

Please sign in to comment.