Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Wav Files (*.wav)|*.wav";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                BufferedAudioPort bap = new BufferedAudioPort(ofd.FileName);
                //AdderNode a1 = new AdderNode();
                //AdderNode a2 = new AdderNode();
                //DelayNode d1 = new DelayNode(750);
                //DelayNode d2 = new DelayNode(500);
                //GainNode g1 = new GainNode(0.4);
                //GainNode g2 = new GainNode(0.3);
                ResamplerNode  r1  = new ResamplerNode(10000);
                ResamplerNode  r2  = new ResamplerNode(10000);
                BitCrusherNode b1  = new BitCrusherNode(6.0);
                BitCrusherNode b2  = new BitCrusherNode(6.0);
                WaveOutPort    wop = new WaveOutPort(bap.WavData, "C:\\Users\\Dustin\\Desktop\\" + Path.GetFileNameWithoutExtension(ofd.FileName) + " - Crushed.wav");

                AudioNode.TieNodes(bap.GetChannel(0), r1);
                //AudioNode.TieNodes(d1, a1);
                //AudioNode.TieNodes(a1, g1);
                //AudioNode.TieNodes(g1, d1);
                AudioNode.TieNodes(r1, b1);
                AudioNode.TieNodes(b1, wop.GetChannel(0));

                AudioNode.TieNodes(bap.GetChannel(1), r2);
                //AudioNode.TieNodes(d2, a2);
                //AudioNode.TieNodes(a2, g2);
                //AudioNode.TieNodes(g2, d2);
                AudioNode.TieNodes(r2, b2);
                AudioNode.TieNodes(b2, wop.GetChannel(1));

                bap.Start();

                wop.Save();
            }
        }
Esempio n. 2
0
 public static void UntieNodes(AudioNode input, AudioNode output)
 {
     input.RemoveOutput(output);
     output.RemoveInput(input);
 }
Esempio n. 3
0
 public static void TieNodes(AudioNode input, AudioNode output)
 {
     input.AddOutput(output);
     output.AddInput(input);
 }
Esempio n. 4
0
 public void RemoveOutput(AudioNode a)
 {
     m_Outputs.Remove(a);
 }
Esempio n. 5
0
 public void AddOutput(AudioNode a)
 {
     m_Outputs.Add(a);
 }
Esempio n. 6
0
 public void RemoveInput(AudioNode a)
 {
     m_Inputs.Remove(a);
 }
Esempio n. 7
0
 public void AddInput(AudioNode a)
 {
     m_Inputs.Add(a);
 }