C# Class GAudio.AGATChunkCopyClientBehaviour

Abstract implementation of IGATChunkCopyClient which provides overridable methods to handle from the main thread reception of audio data copied by the audio thread. Warning: this implementation only requests copies when necessary: not all mixed audio data chunks will be received!
Inheritance: UnityEngine.MonoBehaviour, IGATAudioThreadStreamClient
Show file Open project: gregzo/G-Audio

Public Properties

Property Type Description
observeTrack bool
observedAudioStreamComp UnityEngine.Component
observedChannel int

Protected Properties

Property Type Description
_data float[]
_observedStream IGATAudioThreadStream

Public Methods

Method Description
IGATAudioThreadStreamClient ( float data, int offset, bool emptyData, IGATAudioThreadStream stream ) : void

Protected Methods

Method Description
HandleAudioDataUpdate ( ) : void

Called from Update() whenever new data is available.

HandleNoMoreData ( ) : void

Called from Update() when the audio thread has empty data only. Data is not copied to _data.

Start ( ) : void

If overriden in a derived class, base.Start() should be called first

Private Methods

Method Description
Awake ( ) : void
Update ( ) : void
UpdateObservedStream ( ) : void

Method Details

HandleAudioDataUpdate() protected abstract method

Called from Update() whenever new data is available.
protected abstract HandleAudioDataUpdate ( ) : void
return void

HandleNoMoreData() protected abstract method

Called from Update() when the audio thread has empty data only. Data is not copied to _data.
protected abstract HandleNoMoreData ( ) : void
return void

IGATAudioThreadStreamClient() public method

public IGATAudioThreadStreamClient ( float data, int offset, bool emptyData, IGATAudioThreadStream stream ) : void
data float
offset int
emptyData bool
stream IGATAudioThreadStream
return void

Start() protected method

If overriden in a derived class, base.Start() should be called first
protected Start ( ) : void
return void

Property Details

_data protected property

Holds a copy of the last received audio data.
protected float[] _data
return float[]

_observedStream protected property

protected IGATAudioThreadStream _observedStream
return IGATAudioThreadStream

observeTrack public property

Are we observing a player's track?
public bool observeTrack
return bool

observedAudioStreamComp public property

The component that owns the observed audio stream.
public Component,UnityEngine observedAudioStreamComp
return UnityEngine.Component

observedChannel public property

If the observed audio stream is multi channel, which channel should we de-interleave?
public int observedChannel
return int