public BufferWriterSignal(AudioSignal input, string bufferKey, int previewSize) : base(bufferKey)
		{
			AudioService.AddSink(this);
			InputSignal.Value = input;
			PreviewSize = previewSize;
			if (input == null)
				throw new ArgumentNullException("Input of BufferWriterSignal construcor is null");
		}
Exemple #2
0
 public BufferWriterSignal(AudioSignal input, string bufferKey, int previewSize) : base(bufferKey)
 {
     AudioService.AddSink(this);
     InputSignal.Value = input;
     PreviewSize       = previewSize;
     if (input == null)
     {
         throw new ArgumentNullException("Input of BufferWriterSignal construcor is null");
     }
 }
Exemple #3
0
        public AudioSignal()
        {
            //find all params
            InParams  = AudioSignal.GetInputParams(this).ToArray();
            OutParams = AudioSignal.GetOutputParams(this).ToArray();

            AudioService.Engine.Settings.SampleRateChanged += Engine_SampleRateChanged;
            AudioService.Engine.Settings.BufferSizeChanged += Engine_BufferSizeChanged;
            Engine_SampleRateChanged(null, null);
            Engine_BufferSizeChanged(null, null);
        }
Exemple #4
0
        /// <summary>
        /// Finds all signal parameters by reflection and returns them.
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static IEnumerable <SigParamBase> GetParams(AudioSignal instance)
        {
            var flags  = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
            var fields = instance.GetType().GetFields(flags);

            foreach (var fi in fields)
            {
                if (typeof(SigParamBase).IsAssignableFrom(fi.FieldType))
                {
                    yield return((SigParamBase)fi.GetValue(instance));
                }
            }
        }
Exemple #5
0
 public FFTOutSignal(AudioSignal input)
 {
     InputSignal.Value = input;
 }
		public LTCDecoderSignal(AudioSignal input)
		{
			InputSignal.Value = input;
			FDecoder = new Decoder(AudioEngine.Instance.Settings.SampleRate, 25, 2);
		}
		public AudioToValueSignal(AudioSignal input)
		{
			InputSignal.Value = input;
		}
 public MasterChannel(AudioSignal sig, int channel)
 {
     Signal  = sig;
     Channel = channel;
 }
Exemple #9
0
		public FFTOutSignal(AudioSignal input)
		{
			InputSignal.Value = input;
		}
Exemple #10
0
		public BufferOutSignal(AudioSignal input)
		{
			InputSignal.Value = input;
			Buffer.BufferFilled = BufferFilled;
		}
 public LTCDecoderSignal(AudioSignal input)
 {
     InputSignal.Value = input;
     FDecoder          = new Decoder(AudioEngine.Instance.Settings.SampleRate, 25, 2);
 }
Exemple #12
0
 public ResampleSignal(double srcRate, double dstRate, AudioSignal input, double reqTransBand = 3)
 {
     InputSignal.Value        = input;
     InputSignal.ValueChanged = InputWasSet;
     SetupConverter(srcRate, dstRate, reqTransBand);
 }
 public LevelMeterSignal(AudioSignal input)
 {
     InputSignal.Value = input;
 }
Exemple #14
0
		public ResampleSignal(double srcRate, double dstRate, AudioSignal input, double reqTransBand = 3)
		{
			InputSignal.Value = input;
			InputSignal.ValueChanged = InputWasSet;
			SetupConverter(srcRate, dstRate, reqTransBand);
		}
Exemple #15
0
		//set new input for the pull buffer
		protected void InputWasSet(AudioSignal newInput)
		{
			FPullBuffer.Input = newInput;
		}
 protected void InputWasSet(AudioSignal newInput)
 {
     FWave16Provider = new SampleToWaveProvider16(newInput);
 }
 public AudioToValueSignal(AudioSignal input)
 {
     InputSignal.Value = input;
 }
Exemple #18
0
 //set new input for the pull buffer
 protected void InputWasSet(AudioSignal newInput)
 {
     FPullBuffer.Input = newInput;
 }
		public MasterChannel(AudioSignal sig, int channel)
		{
			Signal = sig;
			Channel = channel;
		}
		public LevelMeterSignal(AudioSignal input)
		{
			InputSignal.Value = input;
		}
		protected void InputWasSet(AudioSignal newInput)
		{
			FWave16Provider = new SampleToWaveProvider16(newInput);
		}
Exemple #22
0
        /// <summary>
        /// Finds all output signal parameters by reflection and returns them.
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static IEnumerable<SigParamBase> GetOutputParams(AudioSignal instance)
        {
            var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
			var fields = instance.GetType().GetFields(flags);
			
            foreach (var fi in fields)
			{
				if(typeof(SigParamBase).IsAssignableFrom(fi.FieldType))
				{
				    var param = (SigParamBase)fi.GetValue(instance);
				    
				    if(param.IsOutput)
				    {
				        yield return param;
				    }
				}
			}
        }
Exemple #23
0
 public BufferOutSignal(AudioSignal input)
 {
     InputSignal.Value   = input;
     Buffer.BufferFilled = BufferFilled;
 }