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; } }
public override void Finish(bool abort) { outputWriter.Close(); outputWriter = null; }