Ejemplo n.º 1
0
        public StereoSignalNode(WaveFormat format, ISignalProcess process)
        {
            if (process == null)
            {
                throw new ArgumentNullException("process", "Process cannot be null");
            }

            if (format == null)
            {
                throw new ArgumentNullException("format", "Must specify audio format");
            }

            this.format = WaveFormat.CreateIeeeFloatWaveFormat(format.SampleRate, 2);

            SignalProcess = process;
            SignalProcess.Format = this.format;

            Name = string.Format("{0} (Stereo)", SignalProcess.Name);

            LeftIn = new SignalSink(this);
            RightIn = new SignalSink(this);

            LeftIn.ReceivedData += LeftIn_ReceivedData;
            RightIn.ReceivedData += RightIn_ReceivedData;

            LeftOut = new SignalSource(this);
            RightOut = new SignalSource(this);
        }
Ejemplo n.º 2
0
        public MonoSignalNode(WaveFormat format, ISignalProcess process)
        {
            if (process == null)
            {
                throw new ArgumentNullException("process", "Process cannot be null");
            }

            if (format == null)
            {
                throw new ArgumentNullException("format", "Must specify audio format");
            }

            this.format = WaveFormat.CreateIeeeFloatWaveFormat(format.SampleRate, 1);

            SignalProcess        = process;
            SignalProcess.Format = this.format;

            Name = string.Format("{0} (Mono)", SignalProcess.Name);

            CentreIn               = new SignalSink(this);
            CentreIn.Name          = "In";
            CentreIn.ReceivedData += input_ReceivedData;

            CentreOut      = new SignalSource(this);
            CentreOut.Name = "Out";
        }
Ejemplo n.º 3
0
        public StereoSignalNode(WaveFormat format, ISignalProcess process)
        {
            if (process == null)
            {
                throw new ArgumentNullException("process", "Process cannot be null");
            }

            if (format == null)
            {
                throw new ArgumentNullException("format", "Must specify audio format");
            }

            this.format = WaveFormat.CreateIeeeFloatWaveFormat(format.SampleRate, 2);

            SignalProcess        = process;
            SignalProcess.Format = this.format;

            Name = string.Format("{0} (Stereo)", SignalProcess.Name);

            LeftIn  = new SignalSink(this);
            RightIn = new SignalSink(this);

            LeftIn.ReceivedData  += LeftIn_ReceivedData;
            RightIn.ReceivedData += RightIn_ReceivedData;

            LeftOut  = new SignalSource(this);
            RightOut = new SignalSource(this);
        }
Ejemplo n.º 4
0
        public MonoSignalNode(WaveFormat format, ISignalProcess process)
        {
            if (process == null)
            {
                throw new ArgumentNullException("process", "Process cannot be null");
            }

            if (format == null)
            {
                throw new ArgumentNullException("format", "Must specify audio format");
            }

            this.format = WaveFormat.CreateIeeeFloatWaveFormat(format.SampleRate, 1);

            SignalProcess = process;
            SignalProcess.Format = this.format;

            Name = string.Format("{0} (Mono)", SignalProcess.Name);

            CentreIn = new SignalSink(this);
            CentreIn.Name = "In";
            CentreIn.ReceivedData += input_ReceivedData;

            CentreOut = new SignalSource(this);
            CentreOut.Name = "Out";
        }
Ejemplo n.º 5
0
        private void mapInputs(int channelCount)
        {
            var inputs = new List<ISignalSource>();

            for (int i = 0; i < device.Channels; i++)
            {
                var source = new SignalSource(this);
                source.Name = string.Format("{0} Input {1}", device.Name, i);
                inputs.Add(source);
            }

            this.Sources = inputs;
        }
Ejemplo n.º 6
0
        private void mapInputs(AsioOut driver)
        {
            var inputCount = driver.DriverInputChannelCount;

            var inputs = new List<ISignalSource>();
            floatBuffer = new float[inputCount][];

            for (int i = 0; i < inputCount; i++)
            {
                var source = new SignalSource(this);
                source.Name = driver.AsioInputChannelName(i);
                inputs.Add(source);
            }
            this.Sources = inputs;
        }