C# Class GAudio.StreamToCacheModule

Component for caching a stream to memory. Multichannel streams will be cached in seperate mono caches. Supports sample accurate start and stop.
Inheritance: AGATStreamObserver
Mostra file Open project: gregzo/G-Audio

Public Properties

Property Type Description
allocateCacheInStart bool
cacheDuration double
useManagedData bool

Public Methods

Method Description
AllocateCaches ( double duration, bool managedData ) : void

Allocates caches retrievable in the Caches property.

OnDestroy ( ) : void
ReleaseCache ( ) : void

If allocated caches use managed data, calling this method makes sure that caches will be returned to the memory pool when possible.

StartCaching ( double dspTime = 0d, GATAudioThreadStreamToCache onAtEnd = null ) : void

Starts caching the stream at a precise dspTime, or asap if no dspTime is provided or if the provided dspTime is too soon. onAtEnd callback is fired when the cache is full, wether looping or not.

StopCaching ( ) : void

Immediately stops caching the stream.

Protected Methods

Method Description
Start ( ) : void

Method Details

AllocateCaches() public method

Allocates caches retrievable in the Caches property.
public AllocateCaches ( double duration, bool managedData ) : void
duration double
managedData bool
return void

OnDestroy() public method

public OnDestroy ( ) : void
return void

ReleaseCache() public method

If allocated caches use managed data, calling this method makes sure that caches will be returned to the memory pool when possible.
public ReleaseCache ( ) : void
return void

Start() protected method

protected Start ( ) : void
return void

StartCaching() public method

Starts caching the stream at a precise dspTime, or asap if no dspTime is provided or if the provided dspTime is too soon. onAtEnd callback is fired when the cache is full, wether looping or not.
public StartCaching ( double dspTime = 0d, GATAudioThreadStreamToCache onAtEnd = null ) : void
dspTime double
onAtEnd GATAudioThreadStreamToCache
return void

StopCaching() public method

Immediately stops caching the stream.
public StopCaching ( ) : void
return void

Property Details

allocateCacheInStart public_oe property

If true, caches will be allocated in start.
public bool allocateCacheInStart
return bool

cacheDuration public_oe property

Duration of the cache to allocate in Start
public double cacheDuration
return double

useManagedData public_oe property

Should the cache be allocated using G-Audio's allocator? Make sure GATManager.DefaultAllocator.LargestAllocatableChunk is large enough if you use managed data.
public bool useManagedData
return bool