Developer Documentation

MediaStream.AudioResample

public virtual bool AudioResample(float[] input, uint outputSampleRate, out float[] output, out int capacity)
public virtual uint AudioResample(float[] input, uint outputSampleRate, float[] output, int capacity)

Set a resampler and resamples a chunk of audio.

Info

This is intended for situations where the audio output pipeline doesn't support 48kHz.

Parameters

NameTypeDescription
inputSingle[]current buffer
outputSampleRateUInt32resample samplerate
outputSingle[]resampled buffer
capacityInt32size of resampled buffer

Returns

TypeDescription
Booleantrue on success or false if missmatch of capacity i.e. errorcode
UInt32sample count on success or errorcode on failure

Variants

AudioResample(input, outputSampleRate, output, capacity)

public virtual bool AudioResample(float[] input, uint outputSampleRate, out float[] output, out int capacity)

Set a resampler and resamples a chunk of audio.

Warning

This is intended for situations where the audio output pipeline doesn't support 48kHz.

Parameters

NameTypeDescription
inputSingle[]current buffer
outputSampleRateUInt32resample samplerate
outputSingle[]resampled buffer
capacityInt32size of resampled buffer

Returns

TypeDescription
Booleantrue on success or false if missmatch of capacity i.e. errorcode

AudioResample(input, outputSampleRate, output, capacity)

public virtual uint AudioResample(float[] input, uint outputSampleRate, float[] output, int capacity)

Set a resampler and resamples a chunk of audio.

Warning

This is intended for situations where the audio output pipeline doesn't support 48kHz.

Parameters

NameTypeDescription
inputSingle[]source buffer
outputSampleRateUInt32to samplerate
outputSingle[]target buffer
capacityInt32target capacity

Returns

TypeDescription
UInt32sample count on success or errorcode on failure