Esempio n. 1
0
 public MainForm(ICollection <Effect> effects)
 {
     InitializeComponent();
     effectChain        = new EffectChain();
     audioPlaybackGraph = new AudioPlaybackGraph(effectChain);
     tabPageRecord.Controls.Add(new RecordingPage()
     {
         Dock = DockStyle.Fill
     });
     tabPageAbout.Controls.Add(new AboutPage()
     {
         Dock = DockStyle.Fill
     });
     connectionStatusPage = new ConnectionStatusPage()
     {
         Dock = DockStyle.Fill
     };
     effectsPage = new EffectsPage(effectChain, effects, audioPlaybackGraph)
     {
         Dock = DockStyle.Fill
     };
     tabPage1.Controls.Add(connectionStatusPage);
     tabPage2.Controls.Add(effectsPage);
     log           = connectionStatusPage.Log;
     audioPipeline = new AudioPipeline(effectChain);
 }
Esempio n. 2
0
        private void PitchMp3File(int semitones)
        {
            var pipeline = new AudioPipeline();

            var options = new EffectsOptions();

            options.Semitones = semitones;
            foreach (var inputMp3Path in this.SelectedItemPaths)
            {
                options.Mp3File = inputMp3Path;
                pipeline.ApplyEffects(options);
            }
        }
Esempio n. 3
0
        private int ApplyEffects(IEffectsOptions options)
        {
            if (options.Semitones == 0)
            {
                MessageBox.Show("Changing the pitch by 0 semitones does not alter the original audio. Skipping.");
                return(0);
            }

            try
            {
                var progressBar = new ProgressBarProgressNotifier(this.ProgressBar, this.ProgressLabel);
                var pipeline    = new AudioPipeline(progressBar);
                pipeline.ApplyEffects(options);

                return(0);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(-1);
            }
        }