Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Channel"/> class.
        /// </summary>
        /// <param name="inputSamples">Input audio samples.</param>
        /// <param name="settings">Audio setting.</param>
        public Channel(double[] inputSamples, IAudioProcessingSettings settings)
        {
            if (inputSamples is null)
            {
                throw new ArgumentNullException(nameof(inputSamples));
            }

            var inputImmutable = ImmutableArray.Create(inputSamples);

            this.scannerTools = new ScannerTools(inputImmutable, settings);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Asynchronously scans audio for damaged samples and repairs them.
        /// </summary>
        /// <param name="status">Parameter to report status through.</param>
        /// <param name="progress">Parameter to report progress through.</param>
        /// <returns>Task.</returns>
        public async Task ScanAsync(
            IProgress <string> status,
            IProgress <double> progress)
        {
            var scanner = new Scanner(this.scannerTools);

            this.scannerTools =
                await scanner.ScanAsync(status, progress).ConfigureAwait(false);

            foreach (var patch in this.scannerTools.PatchCollection.ToList())
            {
                this.RegisterPatch(patch);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Channel"/> class.
 /// </summary>
 /// <param name="inputSamples">Input audio samples.</param>
 /// <param name="settings">Audio setting.</param>
 public Channel(ImmutableArray <double> inputSamples, IAudioProcessingSettings settings)
 {
     this.scannerTools = new ScannerTools(inputSamples, settings);
 }