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"); }
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"); } }
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); }
/// <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)); } } }
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; }
public BufferOutSignal(AudioSignal input) { InputSignal.Value = input; Buffer.BufferFilled = BufferFilled; }
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; }
//set new input for the pull buffer protected void InputWasSet(AudioSignal newInput) { FPullBuffer.Input = newInput; }
protected void InputWasSet(AudioSignal newInput) { FWave16Provider = new SampleToWaveProvider16(newInput); }
/// <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; } } } }