CsoundUnity 4.0.0-alpha.3
Loading...
Searching...
No Matches
Csound.Unity.SpoutRenderer Struct Reference

Drives Csound for one Unity audio block and copies spout into the block's buffer. The two Unity 6 audio paths, AudioPath.IAudioGenerator and AudioPath.RootOutput, both consist of this: they differ in where Unity hands the buffer to them, not in what they do with it, so they embed this and keep their own plumbing. More...

Package Functions

void Render (int instanceId, ChannelBuffer buffer, bool pannedByUnity)
 Fills one block: performs Csound every ksmps frames and writes spout into buffer , honouring mute, pause and the startup fade. Writes silence instead whenever the bridge is not there to be read, so the caller never has to.

Detailed Description

Drives Csound for one Unity audio block and copies spout into the block's buffer. The two Unity 6 audio paths, AudioPath.IAudioGenerator and AudioPath.RootOutput, both consist of this: they differ in where Unity hands the buffer to them, not in what they do with it, so they embed this and keep their own plumbing.

Unmanaged and blittable, like the two structs that hold it: Unity stores them in its own audio memory between invocations, which is also what makes the three fields below persist.

Member Function Documentation

◆ Render()

void Csound.Unity.SpoutRenderer.Render ( int instanceId,
ChannelBuffer buffer,
bool pannedByUnity )
inlinepackage

Fills one block: performs Csound every ksmps frames and writes spout into buffer , honouring mute, pause and the startup fade. Writes silence instead whenever the bridge is not there to be read, so the caller never has to.

Parameters
instanceIdThis instance's key in CsoundBridgeRegistry.
bufferThe block Unity gave the caller, this instance's own.
pannedByUnityTrue on IAudioGenerator, where Unity's panner receives what is written here and sums the channels for a spatialized source. False on RootOutput, which goes to the main output with no panner in between. See AudioPathShared.SpreadDivisor.

The documentation for this struct was generated from the following file: