Previous Topic Index Next Topic
[API function]

FSOUND_Stream_Create

Creates a user definable stream file ready for playing. The stream is serviced through a
callback.

DLL_API FSOUND_STREAM * F_API FSOUND_Stream_Create(
FSOUND_STREAMCALLBACK callback,
int length,
unsigned int mode,
int samplerate,
int userdata
);

Parameters

callback A pointer to a user defined stream callback function.
An example of the callback function would look like this.
void streamcallback(FSOUND_STREAM *stream, void *buff, int len, int param)
{
return TRUE;
}
len in this callback is specified in BYTES.
The return value is whether to end the stream or not. Returning FALSE will
terminate the stream.
length Size of the data in BYTES the callback will require to be written to the
buffer.
mode Description of the raw sample data being opened. see FSOUND_MODES for
a description of these modes.
samplerate Rate of playback. Be careful you dont set the sample rate too high
so that the stream servicer (ie harddisk) cant keep up. A sound that has
a default rate of 44.1khz that is played at 132khz will have to read the
hard disk 3 times faster than normal.
userdata data value that is passed into the stream callback when playing.

Return Value

On success, a pointer to an opened stream is returned.
On failure, NULL is returned.

Remarks

This method only supports SIGNED RAW streams to be written to the buffer supplied by the callback. They can be 8 or 16 bit, mono or stereo.
'length' may be rounded down to the nearest sample alignment in bytes. Ie if you specified 1001 bytes for a 16bit stereo sample stream, len would return 1000 in the callback. (250 samples * 4 bytes per sample)
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2

See Also

FSOUND_MODES , FSOUND_Stream_Close , FSOUND_Stream_Play , FSOUND_Stream_PlayEx , FSOUND_Stream_SetBufferSize , FSOUND_Stream_Stop , FSOUND_STREAMCALLBACK

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Dec 20 16:31:09 2002 by SourceDoc v0.10, the automated source code documenter.