Delegate FileReadProcedure
User file stream read callback function (to be used with FileProcedures).
Namespace: System.Dynamic.ExpandoObject
Assembly: ManagedBass.dll
Syntax
public delegate int FileReadProcedure(IntPtr Buffer, int Length, IntPtr User);
Parameters
IntPtr
Buffer
Pointer to the Buffer to put the data in. |
Int32
Length
Maximum number of bytes to read. |
IntPtr
User
The User instance data given when CreateStream(StreamSystem, BassFlags, FileProcedures, IntPtr) was called. |
Returns
Int32
The number of bytes read... -1 = end of file, 0 = end of file (buffered file stream only). |
Remarks
During creation of the stream, this function should try to return the amount of data requested. After that, it can just return whatever is available up to the requested amount.
For an unbuffered file stream during playback, this function should be as quick as possible - any delays will not only affect the decoding of the current stream, but also all other streams and MOD musics that are playing. It is better to return less data (even none) rather than wait for more data. A buffered file stream isn't affected by delays like this, as this function runs in its own thread then.