Skip to content
Version 2.32.0
↓ Get the launcher

IVoiceInjection.LoadPcm method

Build a clip from caller-supplied 16-bit interleaved PCM at the given sample rate and channel count. Copied immediately (the span need not outlive the call); resampled to the capture format on demand. Use for TTS or generated audio. Main-thread safe; returns at once (no decode).

public IVoiceClip LoadPcm(ReadOnlySpan<short> pcm, int sampleRate, int channels)
parameter description
pcm 16-bit interleaved PCM samples (channel-interleaved frames).
sampleRate Source sample rate in Hz (must be > 0).
channels Source channel count (1 = mono, 2 = stereo, …; must be > 0).