Caches an input stream in seperate mono GATData containers.
Inheritance: IGATAudioThreadStreamClient
コード例 #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);
            }
        }
コード例 #2
0
ファイル: StreamToCacheModule.cs プロジェクト: gregzo/G-Audio
        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 );
            }
        }
コード例 #3
0
ファイル: StreamToCacheModule.cs プロジェクト: gregzo/G-Audio
        /// <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 );
        }