2

I've been searching all over the internet to get this but no vain.

I am working with Steinberg's VST SDK in C++. I am developing an effect plugin and I need to know the length of the sound file, meaning the number of frames within it. So I know the block size or (sampleFrames) from the processReplacing function.

void processReplacing (float **inputs, float **outputs, VstInt32 sampleFrames)

Anyone knows how to get the total number of frames in the whole sound file?

Thanks for the help in advance,

Mike Andrews
  • 3,045
  • 18
  • 28

2 Answers2

6

I think you have a misconception about the way VST effect plug-ins are implemented.

In general, VST is set up for real-time audio processing, with repeated calls to the render function with a value of sampleFrames that is related to the processing latency of the system, and can potentially be in the region of 256 or less.

When implementing processReplacing(), you write the results of processing into the buffers pointed to by outputs - which are passed to you by the host application and are guaranteed to have sampleFrames of space in them.

marko
  • 9,029
  • 4
  • 30
  • 46
2

I don't think this is possible in an effect. Have you thought of making a synth and not an effect? So you could provide your own samples.. "processReplacing" only gets samples from host application and that could be everything (live endless music, sample etc.) Perhaps you have to rethink your plugin design.

bitWorking
  • 12,485
  • 1
  • 32
  • 38