Caches an input stream in seperate mono GATData containers.
Inheritance: IGATAudioThreadStreamClient
Example #1
0
        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);
            }
        }
Example #2
0
        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 );
            }
        }
Example #3
0
        /// <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 );
        }