Version: 2021.3
Experimental: this API is experimental and might be changed or removed in the future.

AudioSampleProvider.ConsumeSampleFramesNativeFunction

切换到手册
public delegateuint ConsumeSampleFramesNativeFunction (uint providerId, IntPtr interleavedSampleFrames, uint sampleFrameCount);

参数

providerId 提供程序 ID。请参阅 AudioSampleProvider.id
interleavedSampleFrames 指向要填充的样本帧缓冲区的指针。实际的 C 类型是 float*。
sampleFrameCount 可以写入 interleavedSampleFrames 中的样本帧数。

描述

表示用于使用样本帧的原生函数指针的类型。

可通过以下方式导入假定的原生设置函数:

[DllImport(pluginName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
private static extern void SetConsumeSampleFramesFunction(
    AudioSampleProvider.ConsumeSampleFramesNativeFunction cb, uint id, ushort channelCount, uint sampleRate);

要了解如何调用此原生插件函数,请参阅 AudioSampleProvider.consumeSampleFramesNativeFunction