Reading a WAV file into VST.Net to process with a plugin

Posted by Paul on Stack Overflow See other posts from Stack Overflow or by Paul
Published on 2010-04-13T21:00:09Z Indexed on 2010/04/13 21:03 UTC
Read the original article Hit count: 550

Filed under:
|
|
|
|

Hello, I'm trying to use the VST.Net and NAudio frameworks to build an application that processes audio using a VST plugin.

Ideally, the application should load a wav or mp3 file, process it with the VST, and then write a new file.

I have done some poking around with the VST.Net library and was able to compile and run the samples (specifically the VST Host one). What I have not figured out is how to load an audio file into the program and have it write a new file back out.

I'd like to be able to configure the properties for the VST plugin via C#, and be able to process the audio with 2 or more consecutive VSTs.

Using NAudio, I was able to create this simple script to copy an audio file. Now I just need to get the output from the WaveFileReader into the VST.Net framework somehow.

  private void processAudio()
    {
        reader = new WaveFileReader("c:/bass.wav");
        writer = new WaveFileWriter("c:/bass-copy.wav", reader.WaveFormat);
        int read;
        while ((read = reader.Read(buffer, 0, buffer.Length)) > 0)
        {
            writer.WriteData(buffer, 0, read);
        }

        textBox1.Text = "done";

        reader.Close();
        reader.Dispose();
        writer.Close();
        writer.Dispose();
    }

Please help!! Thanks

References:

http://vstnet.codeplex.com (VST.Net)

http://naudio.codeplex.com (NAudio)

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET