AudioQueueProcessingTapDelegate Delegate
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Signature for AudioQueue's Tap callback handlers.
public delegate uint AudioQueueProcessingTapDelegate(AudioQueueProcessingTap audioQueueTap, uint numberOfFrames, ref AudioTimeStamp timeStamp, ref AudioQueueProcessingTapFlags flags, AudioBuffers data);
type AudioQueueProcessingTapDelegate = delegate of AudioQueueProcessingTap * uint32 * * * AudioBuffers -> uint32
Parameters
- audioQueueTap
- AudioQueueProcessingTap
Context for the callback, provides access to resources that the Tap can use and parameters of the Tap configuration.
- numberOfFrames
- UInt32
Number of frames that the method should render.
- timeStamp
- AudioTimeStamp
For input queues, return the timestamp, for output queues, the current timestamp.
On entry, the flags describe the kind of tap being performed (PreEffect, PostEffect or Siphon). It might also contain the value StartOfStream to indicate that a reset to the beginning is requested. On output it should have updated the StartOfStream and EndOfStream flags.
- data
- AudioBuffers
Siphoning taps can inspect the contents of the individual AudioBuffers in place but must not make changes to it. Other taps should allocate and fill the buffers as needed.
Return Value
Number of frames provided in data.
Remarks
Call GetSourceAudio until the desired number of audio frames required by the tap to work is received.
If the taps are unable to fullfill the requested number of frames requested, the AudioQueue will fill the gap with silence.
On entry, the flags might contain a StartOfStream request as well as information about what kind of tap this is (running before an effect, after an effect or just a Siphon). Your callback can modify the data buffers for non-Siphon cases. For Siphon, it should merely examine, but not alter the contents.
On exit for non-Siphon cases, the flags should be updated with StartOfStream and EndOfStream flags depending on the return values from AudioQueueProcessingTap's GetSourceAudio method.
For non-siphon cases, the tap should allocate the contents of the AudioBuffer contents and ensure that they remain valid until the next time the Tap callback is invoked.