BASS_StreamCreate

Creates a user sample stream.

HSTREAM WINAPI BASS_StreamCreate(
    DWORD freq,
    DWORD flags,
    STREAMPROC *proc
    DWORD user
);

Parameters
freqThe default sample rate (between 100 and 100000). The sample rate can be changed at any time using BASS_ChannelSetAttributes.
flagsAny combination of these flags.
BASS_SAMPLE_8BITSUse 8 bit resolution, else 16 bit.
BASS_SAMPLE_MONOUse mono, else stereo.
BASS_SAMPLE_3DUse 3D functionality. This is ignored if BASS_DEVICE_3D wasn't specified when calling BASS_Init.
procThe user defined stream writing function.
userUser 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_INITBASS_Init has not been successfully called.
BASS_ERROR_FREQfreq is out of range... DirectSound only allows sample rates between 100 and 100000.
BASS_ERROR_FORMATThe specified format is not supported.
BASS_ERROR_MEMThere is insufficent memory.
BASS_ERROR_NO3DCouldn't initialize 3D support for the stream.
BASS_ERROR_UNKNOWNSome 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