BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_StreamPutFileData Method (Int32, IntPtr, Int32)BASS.NET API for the Un4seen BASS Audio Library
Adds data to a "push buffered" user file stream's buffer.

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

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static int BASS_StreamPutFileData(
	int handle,
	IntPtr buffer,
	int length
)

Parameters

handle
Type: SystemInt32
The stream handle (as created with BASS_StreamCreateFileUser(BASSStreamSystem, BASSFlag, BASS_FILEPROCS, IntPtr) and the STREAMFILE_BUFFERPUSH system flag.).
buffer
Type: SystemIntPtr
Pointer to the file data.
length
Type: SystemInt32
The amount of data in bytes, or BASS_STREAMPROC_END to end the file.

Return Value

Type: Int32
If successful, the number of bytes read from buffer is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

If there is not enough space in the stream's file buffer to receive all of the data, then only the amount that will fit is read from buffer. BASS_StreamGetFilePosition(Int32, BASSStreamFilePosition) can be used to check the amount of space in the buffer.

File data should be provided at a rate sufficent to sustain playback. If there is insufficient file data, and the playback buffer is subsequently exhausted, BASS will automatically stall playback of the stream, until more data is available. A BASS_SYNC_STALL sync can be set via BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr), to be triggered upon playback stalling or resuming.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_NOTAVAILThe stream is not using the STREAMFILE_BUFFERPUSH file system.
BASS_ERROR_ENDEDThe stream has ended.

See Also

Reference