Adds data to a "push buffered" user file stream's buffer.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.2
Syntax
[DllImportAttribute("bass")] 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: Int32If 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 CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_NOTAVAIL | The stream is not using the STREAMFILE_BUFFERPUSH file system. |
BASS_ERROR_ENDED | The stream has ended. |
See Also