GAudio.GATAudioThreadStreamSplitter.GATAudioThreadStreamSplitter C# (CSharp) Méthode

GATAudioThreadStreamSplitter() public méthode

The splitter will begin broadcasting it's sub streams immediately.
public GATAudioThreadStreamSplitter ( IGATAudioThreadStream stream, GATDataAllocationMode bufferAllocationMode ) : System
stream IGATAudioThreadStream
bufferAllocationMode GATDataAllocationMode
Résultat System
        public GATAudioThreadStreamSplitter( IGATAudioThreadStream stream, GATDataAllocationMode bufferAllocationMode )
        {
            int i;

            _sourceStreamChannels = stream.NbOfChannels;
            if( _sourceStreamChannels < 2 )
            {
                Debug.LogWarning( "source stream is mono: " + stream.StreamName );
            }

            IntPtr outputBufferPointer = IntPtr.Zero;

            _sharedBufferSize	= stream.BufferSizePerChannel;

            if( bufferAllocationMode == GATDataAllocationMode.Unmanaged )
            {
                _sharedBufferArray = new float[ _sharedBufferSize ];
                _sharedBuffer = new GATData( _sharedBufferArray );
            }
            else
            {
                if( bufferAllocationMode == GATDataAllocationMode.Fixed )
                {
                    _sharedBuffer = GATManager.GetFixedDataContainer( _sharedBufferSize, "StreamSplitter buffer" );
                }
                else
                {
                    _sharedBuffer = GATManager.GetDataContainer( _sharedBufferSize );
                }

                _sharedBufferArray 	= _sharedBuffer.ParentArray;
                outputBufferPointer = _sharedBuffer.GetPointer();
            }

            _memOffset			= _sharedBuffer.MemOffset;

            _streamProxies = new GATAudioThreadStreamProxy[ _sourceStreamChannels ];

            for( i = 0; i < _sourceStreamChannels; i++ )
            {
                _streamProxies[ i ] = new GATAudioThreadStreamProxy( _sharedBufferSize, 1, outputBufferPointer, _sharedBuffer.MemOffset, ( stream.StreamName + " split " + i ) );
            }

            stream.AddAudioThreadStreamClient( this );

            _sourceStream = stream;
        }