Beispiel #1
0
        public OutputSelectableFileDestinationHandler(
            string destinationPath,
            NumChannelsType channels,
            NumBitsType bits,
            int samplingRate,
            OutputSelectableFileArguments arguments)
        {
            outputStream = new FileStream(
                destinationPath,
                FileMode.Create,
                FileAccess.ReadWrite,
                FileShare.None,
                Constants.BufferSize);
            switch (Path.GetExtension(destinationPath).ToLowerInvariant())
            {
            default:
                Debug.Assert(false);
                throw new ArgumentException();

            case ".wav":
                outputWriter = new WAVWriter(
                    outputStream,
                    channels,
                    bits,
                    samplingRate);
                break;

            case ".aif":
            case ".aiff":
                outputWriter = new AIFFWriter(
                    outputStream,
                    channels,
                    bits,
                    samplingRate);
                break;
            }
        }
Beispiel #2
0
 public override void Finish(bool abort)
 {
     outputWriter.Close();
     outputWriter = null;
 }