我已经成功地简化了Vst.net host sample,使其可以直接加载vst仪器。大多数情况下,我只是剥离了GUI,让它自动触发一些测试笔记。当我将其构建为控制台应用程序时,此代码可以正常工作。
using System;
using Jacobi.Vst.Core;
using Jacobi.Vst.Interop.Host;
using NAudio.Wave;
using CommonUtils.VSTPlugin;
namespace Jacobi.Vst.Samples.Host
{
///<Summary>
/// Gets the answer
///</Summary>
public class pianoVST
{
///<Summary>
/// Gets the answer
///</Summary>
public static VST vst = null;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
}
/// <summary>
/// Play some test notes.
/// </summary>
public void playTest()
{
var asioDriverNames = AsioOut.GetDriverNames();
if (asioDriverNames.Length > 0)
{
MidiVstTest.UtilityAudio.OpenAudio(MidiVstTest.AudioLibrary.NAudio, asioDriverNames[0]);
MidiVstTest.UtilityAudio.StartAudio();
vst = MidiVstTest.UtilityAudio.LoadVST("[path-to-vst-dll]");
for (int i = 0; i < 3; i++)
{
vst.MIDI_NoteOn(60, 100);
System.Threading.Thread.Sleep(1000);
vst.MIDI_NoteOn(60, 0);
System.Threading.Thread.Sleep(1000);
}
}
}
}
}但是,当我将其作为dll构建时,将其导入Unity,然后将其附加到一个简单的GameObject,我无法使其运行或构建。我得到的错误消息是:
ArgumentException: The Assembly Jacobi.Vst.Interop is referenced by Jacobi.Vst.Samples.Host ('Assets/Jacobi.Vst.Samples.Host.dll'). But the dll is not allowed to be included or could not be found.我已经从源代码重新构建了,但是我做的任何事情都不能使它与C++一起工作。
有没有什么我可以做的,让Unity和Jacobi.Vst.Interop很好地协同工作?
发布于 2019-03-03 04:22:41
VST.Net依赖于VC110.CRT包。该错误可能是由于没有安装VC运行时造成的。
https://github.com/obiwanjacobi/vst.net/blob/master/docs/Using_VST.NET.md
https://stackoverflow.com/questions/50437265
复制相似问题