BASS.NET API for the Un4seen BASS Audio LibraryWaveWriter Constructor (String, Int32, Int32, Int32, Boolean)BASS.NET API for the Un4seen BASS Audio Library
Create a WaveWrite instance to save sample data to be processed to a wave file.

Namespace: Un4seen.Bass.Misc
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

public WaveWriter(
	string fileName,
	int numChannels,
	int sampleRate,
	int bitsPerSample,
	bool rewrite
)

Parameters

fileName
Type: SystemString
Fully referenced path and file name of the Wave file to create.
numChannels
Type: SystemInt32
Number of channels of the wave file (1=mono, 2=stereo...).
sampleRate
Type: SystemInt32
Sample rate of the wave file (e.g. 8000, 11025, 22050, 44100, 48000, 96000) in Hz.
bitsPerSample
Type: SystemInt32
Bits per sample of the wave file (must be either 8, 16, 24 or 32).
rewrite
Type: SystemBoolean
Specifies, if an existing fileName should be overwritten (=overwrite, =do not overwrite).
Exceptions

ExceptionCondition
IOExceptionThe file already exists (only raised if the rewrite has not been used). Or the Wave Header could not be written.
Remarks

The sample data provided when calling the Write(IntPtr, Int32) method must conform these settings (ie. NumChannels, SampleRate and BitsPerSample)! No resampling will be applied here.

When you have specified 24 bitsPerSample the sample data must be provided as float values when using the Write(IntPtr, Int32) method (the float sample will actually be converted to 24-bit samples)!

If the stream contains more than 2 channels (e.g. multi-channel) or is defined with 24-bit resolution the Wave file will be written in the WAVE_FORMAT_EXTENSIBLE format.

See Also

Reference