This project has moved. For the latest updates, please go here.

Storing Audio samples in an Input Audio Buffer

Nov 22, 2010 at 1:16 PM

Hi, I have a slight problem with the AudioProcessor() class. I want to be able to store audio samples in the input audio buffer so i can use them for further processing.

I tried with the resource folder of visual c#, but when i play the files, the host (fl studio) does not recognise it (there's no audio feedback from the mixer). i later figured out i was only playing the file directly from my sound card just like media player.

upon repeated reading of vst.net documentation (AudioProcessor class), i realise the vst host only recognise audio samples only when stores into a buffer. not the big  question is: How do I store audio samples?

Any help, no matter how little will be most appreciated. thanx

Coordinator
Nov 22, 2010 at 1:22 PM

The title suggest you want to store the IN the input buffer...?

If you would write out the samples to a file format that the host understood (a common format, like .wav), would that satisfy the 'further processing'?

Nov 22, 2010 at 1:55 PM

 

Yes it would. because the whole idea is to later process the files back to the host as audio file (.wav)

Coordinator
Nov 22, 2010 at 3:51 PM

Well, then you should check out NAudio here on codeplex. It has, when I remember correctly, a class to read and (perhaps also write) a wav file. Assuming .wav is a format that most hosts know how to read (which is probably true).

Note that the .wav file uses an interlaced format using integers and VST uses separate buffers using floats. So you need to do some conversion.
There are several discussion threads here that also discuss this (search for it).

You also have to think about when the files are written (at what time). Do you append to it as you 'record' or do you allow manipulation in your plugin and save the result. Be mindfull of how much memory you use buffering these recorded samples.

Hope it helps.
Marc