示例#1
0
        private void CleanVinylRecording(string presetName, int noiseReductionPasses, SfAudioSelection noiseprintSelection)
        {
            SfAudioSelection selection = _fileTasks.SelectAll();

            _fileTasks.ApplyEffectPreset(App, selection, EffectNames.ClickAndCrackleRemoval, presetName, EffectOptions.EffectOnly, Output.ToScriptWindow);
            for (int i = 1; i <= noiseReductionPasses; i++)
            {
                Output.ToScriptWindow("Noise Reduction (pass #{0})", i);
                EffectOptions noiseReductionOption = EffectOptions.EffectOnly;
                //if (i == 1)
                //    noiseReductionOption = EffectOptions.DialogFirst;
                _fileTasks.CopySelectionToStart(App, noiseprintSelection);
                _fileTasks.ApplyEffectPreset(App, selection, EffectNames.NoiseReduction, presetName, noiseReductionOption, Output.ToScriptWindow);
                _file.Window.SetSelectionAndScroll(0, _noiseprintSelection.Length, DataWndScrollTo.NoMove);
                App.DoMenuAndWait("Edit.Delete", false);
            }
            Output.LineBreakToScriptWindow();
        }
示例#2
0
        private void DoTrackSplitting(SplitTrackList tracks, ICreateTrackMarkerNames trackMarkerNameBuilder)
        {
            //App.FindRenderer("FLAC Audio", "flac");
            //foreach (ISfRenderer r in App.Renderers)
            //{
            //    Output.LineBreakToScriptWindow();
            //    Output.ToScriptWindow(r.Name);
            //    Output.ToScriptWindow(r.Extension);
            //    Output.ToScriptWindow(r.Guid);
            //    foreach (ISfGenericPreset preset in r.Templates)
            //    {
            //        Output.ToScriptWindow(preset.Name);
            //    }
            //}
            //tracks.Clear();
            foreach (SplitTrackDefinition track in tracks)
            {
                ISfFileHost trackFile = _file.NewFile(track.GetSelectionWithFades());
                trackFile.Markers.Clear();
                trackFile.Summary.Album   = _tbxAlbum.Text;
                trackFile.Summary.Artist  = _tbxArtist.Text;
                trackFile.Summary.TrackNo = string.Concat(track.Number, "/", tracks.Count);

                FileTasks trackTasks = new FileTasks(trackFile);
                if (track.AddFadeIn)
                {
                    Output.ToScriptWindow("Track {0}: Fade In {1} Samples", track.Number, track.FadeInLength);
                    trackFile.Window.SetSelectionAndScroll(0, track.FadeInLength, DataWndScrollTo.NoMove);
                    App.DoMenuAndWait("Process.FadeIn", false);
                }
                if (track.AddFadeOut)
                {
                    Output.ToScriptWindow("Track {0}: Fade Out {1} Samples", track.Number, track.FadeOutLength);
                    trackFile.Window.SetSelectionAndScroll(track.FadeOutStartPosition, trackFile.Length, DataWndScrollTo.NoMove);
                    App.DoMenuAndWait("Process.FadeOut", false);
                }
                trackTasks.ApplyEffectPreset(App, trackTasks.SelectAll(), "iZotope MBIT+ Dither", "Convert to 16 bit (advanced light dither)", EffectOptions.EffectOnly, Output.ToScriptWindow);

                string savePath = string.Concat(_outputDirectory, Path.DirectorySeparatorChar, trackMarkerNameBuilder.GetRegionMarkerName(track.Number) + ".flac");
                trackFile.SaveAs(savePath, "FLAC Audio", "44,100 Hz, 16 Bit, Stereo", RenderOptions.SaveMetadata);
                trackFile.Close(CloseOptions.QuerySaveIfChanged);

                Output.ToScriptWindow("Saved '{0}'", savePath);
                Output.LineBreakToScriptWindow();
            }
        }