Business.AutoPitchBusiness.AppyAutoPitch C# (CSharp) Метод

AppyAutoPitch() публичный статический Метод

Applies 432hz auto-pitch if file PixelAspectRatio is 1 and FPS can be read.
public static AppyAutoPitch ( Media video ) : bool
video DataAccess.Media The video for which to create the auto-pitch script file.
Результат bool
        public static bool AppyAutoPitch(Media video) {
            using (MediaInfoReader InfoReader = new MediaInfoReader()) {
                InfoReader.LoadInfo(Settings.NaturalGroundingFolder + video.FileName);
                if (Settings.SavedFile.ChangeAudioPitch && InfoReader.PixelAspectRatio == 1 && !video.DisablePitch && (InfoReader.BitDepth ?? 8) == 8) {
                    CreateScript(Settings.NaturalGroundingFolder + video.FileName, InfoReader);
                    return true;
                } else
                    return false;
            }
        }

Usage Example

        public async Task ReplayLastAsync()
        {
            if (!player.IsAvailable)
            {
                return;
            }

            if (playedVideos.Count > 1)
            {
                Media LastVideo = PlayerAccess.GetVideoById(playedVideos[playedVideos.Count - 2]);
                if (LastVideo.MediaId != player.CurrentVideo.MediaId)
                {
                    playedVideos.RemoveAt(playedVideos.Count - 1);
                    if (nextVideo != null)
                    {
                        CancelNextDownload(nextVideo);
                    }
                    nextVideo = player.CurrentVideo;

                    // Enable/Disable SVP if necessary.
                    MpcConfigBusiness.AutoConfigure(nextVideo);

                    // Auto-pitch to 432hz
                    bool EnableAutoPitch = AutoPitchBusiness.AppyAutoPitch(LastVideo);

                    await player.PlayVideoAsync(LastVideo, EnableAutoPitch).ConfigureAwait(false);

                    Application.Current.Dispatcher.Invoke(() => PlaylistChanged?.Invoke(this, new EventArgs()));
                }
            }
        }
All Usage Examples Of Business.AutoPitchBusiness::AppyAutoPitch