protected override void Start() { if (_isInited) { return; } base.Start(); if (_stream == null) { this.enabled = false; return; } _streamToCache = new GATAudioThreadStreamToCache(_stream, null); _isInited = true; if (allocateCacheInStart) { AllocateCaches(cacheDuration, useManagedData); } }
protected override void Start() { if( _isInited ) return; base.Start(); if( _stream == null ) { this.enabled = false; return; } _streamToCache = new GATAudioThreadStreamToCache( _stream, null ); _isInited = true; if( allocateCacheInStart ) { AllocateCaches( cacheDuration, useManagedData ); } }
/// <summary> /// 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. /// </summary> public void StartCaching( double dspTime = 0d, GATAudioThreadStreamToCache.AtEndHandler onAtEnd = null ) { if( _streamToCache == null || Caches == null ) { throw new GATException( "No cache is setup." ); } _streamToCache.Start( dspTime, onAtEnd ); }