Struct RenderContext
- Namespace
- Sigil.Sound
- Assembly
- Sigil.Sound.dll
Everything an operator needs to know about the render it belongs to. Passed explicitly when a Sigil.Sound.Sound is compiled; there is no global audio context.
public readonly record struct RenderContext : IEquatable<RenderContext>Implements
Inherited Members
Constructors
RenderContext(int, int)
Everything an operator needs to know about the render it belongs to. Passed explicitly when a Sigil.Sound.Sound is compiled; there is no global audio context.
public RenderContext(int SampleRate, int BlockSize = 256)Parameters
SampleRateint-
Frames per second.
BlockSizeint-
The largest block the renderer will ask for. Operators size scratch buffers to this at compile time; Sigil.Sound.IOperator.RenderBlock(System.Span{Sigil.Sound.StereoFrame}) is never called with a longer span.
Fields
DefaultBlockSize
The default largest block size: 256 frames.
public const int DefaultBlockSize = 256Field Value
DefaultSampleRate
The sample rate of Sigil.Sound.RenderContext.Default: 48 kHz.
public const int DefaultSampleRate = 48000Field Value
Properties
BlockSize
The largest block the renderer will ask for. Operators size scratch buffers to this at compile time; Sigil.Sound.IOperator.RenderBlock(System.Span{Sigil.Sound.StereoFrame}) is never called with a longer span.
public int BlockSize { get; init; }Property Value
Clock
The host's clock, or null for sounds that count time from their own first frame (the default). See Sigil.Sound.HostClock for what following a clock changes.
public HostClock? Clock { get; init; }Property Value
Default
A 48 kHz context with the default block size.
public static RenderContext Default { get; }Property Value
Nyquist
Half the sample rate.
public double Nyquist { get; }Property Value
SamplePeriod
Seconds per frame.
public double SamplePeriod { get; }Property Value
SampleRate
Frames per second.
public int SampleRate { get; init; }Property Value
Methods
Validate()
Throws if the sample rate or block size is not positive; otherwise returns this context.
public RenderContext Validate()