Fwrite in processblock


#1

I develop audio plugin such as au, vst, aax
I try fwrite in “processblock”.

but we don’t know when the track end?

and worries fopen and write cause noise, jitter
( I’ll use offline bouncing)


#2

No, no no no!

Have a look at the AudioFormatWriter::ThreadedWriter class if you’re trying to record a file.


#3

yeah, I see the class AudioFormatWriter::ThreadedWriter

if i use write in AudioFormatWriter::ThreadedWriter.
is right approach write each frame? (in processblock - not realtime just for use offline bouncing)

or memcpy to heap and write once (using AudioFormatWriter::ThreadedWriter) - but i know know when the track end?

would give a advice?


#4

Have a look at the AudioRecordingDemo.cpp code to see you to record audio data from the audio thread. Obviously, the demo is a standalone app and not a vst plug-in. So basically you need to take the code of the demo’s audioDeviceIOCallback, audioDeviceAboutToStart, audioDeviceStopped methods and pop them into your AudioProcessor’s processBlock, prepareToPlay and releaseResources methods.