Creates a user sample stream.
HSTREAM WINAPI BASS_StreamCreate( |
Parameters
freq | The default sample rate (between 100 and 100000). The sample rate can be changed at any time using BASS_ChannelSetAttributes. | ||||||
flags | Any combination of these flags.
| ||||||
proc | The user defined stream writing function. | ||||||
user | User instance data to pass to the callback function. |
Return value
If successful, the new stream's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_INIT | BASS_Init has not been successfully called. |
BASS_ERROR_FREQ | freq is out of range... DirectSound only allows sample rates between 100 and 100000. |
BASS_ERROR_FORMAT | The specified format is not supported. |
BASS_ERROR_MEM | There is insufficent memory. |
BASS_ERROR_NO3D | Couldn't initialize 3D support for the stream. |
BASS_ERROR_UNKNOWN | Some other mystery problem! |
Remarks
Sample streams allow any sample format to be played through BASS, and are particularly useful for playing a large amount of sample data without requiring a large amount of memory. If you wish to play a sample format that BASS does not support, then you can create a stream and decode the sample data into it.
BASS can automatically stream MP3 and WAV files, see BASS_StreamCreateFile for details.
See also
BASS_ChannelSet3DAttributes, BASS_ChannelSet3DPosition, BASS_ChannelSetAttributes, BASS_ChannelSetEAXMix, BASS_StreamCreateFile, BASS_StreamFree, BASS_StreamPlay, STREAMPROC callback