Use this method to provide sample data to the WaveWriter and write these samples to the wave file.
Namespace: Un4seen.Bass.Misc
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
Parameters
- buffer
- Type: SystemByte
An array of byte values to write to the wave file. - length
- Type: SystemInt32
The number of BYTEs in the buffer.
Remarks
However, the data written to the wave file will NOT be converted and must be in the BitsPerSample resolution (as specified in the constructor).
Examples
int stream = Bass.BASS_StreamCreateFile("test.ogg", 0, 0, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_8BITS); WaveWriter WW = new WaveWriter("test.wav", stream, true); byte[] data = new byte[32768]; while (Bass.BASS_ChannelIsActive(stream) == BASSActive.BASS_ACTIVE_PLAYING) { int length = Bass.BASS_ChannelGetData(stream, data, 32768); if (length > 0) WW.WriteNoConvert(data, length); } // finilize the wave file! WW.Close(); Bass.BASS_StreamFree(stream);
See Also