GAudio.GATAudioThreadStreamToCache.Start C# (CSharp) Метод

Start() публичный Метод

Start caching the stream.
public Start ( double targetDspTime = 0d, AtEndHandler handler = null ) : void
targetDspTime double The dsp time at which caching should start. Pass 0 to start as soon as possible.
handler AtEndHandler Optional callback fired when the cache is full.
Результат void
        public void Start( double targetDspTime = 0d, AtEndHandler handler = null )
        {
            if( _vDoCache || _waiting )
                return;

            _waiting = true;
            _vPosition = 0;
            _onEnd = handler;
            _targetDspTime = targetDspTime;
            _stream.AddAudioThreadStreamClient( this );
        }

Usage Example

Пример #1
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);
        }