Class AudioRenderer
Utility component used to play audio frames obtained from a WebRTC audio source.
Namespace: Microsoft.MixedReality.WebRTC.Unity
Assembly: cs.temp.dll.dll
Syntax
public class AudioRenderer : MonoBehaviour
Remarks
Calling StartRendering(IAudioSource) and StopRendering(IAudioSource)
will start/stop playing the passed
The component will play only while enabled.
Fields
PadWithSine
If true, pad buffer underruns with a sine wave. This will cause artifacts on underruns. Use for debugging.
Declaration
public bool PadWithSine
Field Value
Type | Description |
---|---|
Boolean |
Methods
Awake()
Declaration
protected void Awake()
OnAudioFilterRead(Single[], Int32)
Declaration
protected void OnAudioFilterRead(float[] data, int channels)
Parameters
Type | Name | Description |
---|---|---|
Single[] | data | |
Int32 | channels |
OnDestroy()
Declaration
protected void OnDestroy()
OnDisable()
Declaration
protected void OnDisable()
OnEnable()
Declaration
protected void OnEnable()
StartRendering(IAudioSource)
Start rendering the passed source.
Declaration
public void StartRendering(IAudioSource source)
Parameters
Type | Name | Description |
---|---|---|
IAudioSource | source |
Remarks
Can be used to handle AudioStreamStarted.
StopRendering(IAudioSource)
Stop rendering the passed source. Must be called with the same source passed to StartRendering(IAudioSource)
Declaration
public void StopRendering(IAudioSource source)
Parameters
Type | Name | Description |
---|---|---|
IAudioSource | source |
Remarks
Can be used to handle AudioStreamStopped.