예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MasterAudioUtility"/> class.
        /// Creates a new audio utility that can be used to convert and segment audio, and to get information about audio.
        /// The given audio utility instances will be used.
        /// </summary>
        /// <param name="ffmpegUtility">ffmpeg utility.
        /// </param>
        /// <param name="mp3SpltUtility">mp3splt utility.
        /// </param>
        /// <param name="wvunpackUtility">wxunpack utility.
        /// </param>
        /// <param name="soxUtility">sox utility.
        /// </param>
        /// <param name="ffmpegRawPcmUtility">The ffmpeg utility for converting raw PCM data</param>
        /// <param name="temporaryFilesDirectory">Directory for temporary files.</param>
        public MasterAudioUtility(
            FfmpegAudioUtility ffmpegUtility,
            Mp3SpltAudioUtility mp3SpltUtility,
            WavPackAudioUtility wvunpackUtility,
            SoxAudioUtility soxUtility,
            FfmpegRawPcmAudioUtility ffmpegRawPcmUtility,
            DirectoryInfo temporaryFilesDirectory = null)
        {
            this.wvunpackUtility     = wvunpackUtility;
            this.mp3SpltUtility      = mp3SpltUtility;
            this.ffmpegUtility       = ffmpegUtility;
            this.ffmpegRawPcmUtility = ffmpegRawPcmUtility;
            this.soxUtility          = soxUtility;

            this.TemporaryFilesDirectory = temporaryFilesDirectory ?? TempFileHelper.TempDir();

            this.Validate();
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MasterAudioUtility"/> class.
        /// Creates a new audio utility that can be used to convert and segment audio, and to get information about audio.
        /// </summary>
        public MasterAudioUtility()
        {
            this.wvunpackUtility = new WavPackAudioUtility(new FileInfo(AppConfigHelper.WvunpackExe));

            var mp3SpltExe = AppConfigHelper.Mp3SpltExe;

            if (mp3SpltExe != null)
            {
                this.mp3SpltUtility = new Mp3SpltAudioUtility(new FileInfo(mp3SpltExe));
            }

            this.ffmpegUtility       = new FfmpegAudioUtility(new FileInfo(AppConfigHelper.FfmpegExe), new FileInfo(AppConfigHelper.FfprobeExe));
            this.ffmpegRawPcmUtility = new FfmpegRawPcmAudioUtility(new FileInfo(AppConfigHelper.FfmpegExe));
            this.soxUtility          = new SoxAudioUtility(new FileInfo(AppConfigHelper.SoxExe));

            this.TemporaryFilesDirectory = this.TemporaryFilesDirectory ?? TempFileHelper.TempDir();

            this.Validate();
        }