Previous Topic Index Next Topic
[API function]

FSOUND_Stream_Play

Starts a pre-opened stream playing.

int F_API FSOUND_Stream_Play(
int channel,
FSOUND_STREAM *stream
);

Parameters

channel 0+ The channel index in the channel pool.. This must not exceed
the maximum number of channels allocated with FSOUND_Init
FSOUND_FREE
Chooses a free channel to play in. If all channels are used then it
selects a channel with a sample playing that has a lower priority than the
sample to be played.
stream Pointer to the already opened stream to be played.

Return Value

On success, the channel handle the stream is playing in is returned.
On failure, -1 is returned.

Remarks

When a stream starts to play, it reserves a channel at the highest priority. It cannot
be rejected by other sound effect channels in the normal fashion. If you try to start
a stream when all the allocated channels are playing, it will kick out the lowest priority
channel it can find, but failing that (all channels are at high priority), it will kick out
the first channel it finds.
If you dont want streams to reserve a channel, then use FSOUND_SetReserved(channel, FALSE)
on the stream straight after you play it and get the channel handle from FSOUND_Stream_Play.
--------
Important : If you are streaming a STEREO sample, and using normal middle panning, it will
only come out at half the volume they are supposed to, as it gives half the amplitude to each
channel. FSOUND_STEREOPAN is recommended for this which will center the sound and give it normal amplitude.
See FSOUND_SetPan for more information on this.
--------
You can use normal channel based commands (such as FSOUND_SetVolume etc) on the return handle, as it is a channel handle. (except for WMA and internet streamed streams)
--------
NOTE : WMA/ASF/Internet streams are a limited implementation because of the way the formats work.. Note the following limitations
- Multiple WMA/ASF/Internet streams streams are not supported.
- Playing WMA/ASF/Internet streams do not run through the software engine, and will not show up in the DSP chain output.
- Streaming WMA/ASF from memory is not supported.
- WMA/ASF/Internet stream playback will always comes from primary sound device.
- WMA/ASF/Internet streams cannot loop, the flag will be ignored.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2

See Also

FSOUND_Init , FSOUND_SetPan , FSOUND_SetReserved , FSOUND_SetVolume , FSOUND_Stream_Close , FSOUND_Stream_Create , FSOUND_Stream_OpenFile , FSOUND_Stream_Play , FSOUND_Stream_PlayEx , FSOUND_Stream_SetEndCallback , FSOUND_Stream_SetSynchCallback , FSOUND_Stream_Stop

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Aug 16 15:40:22 2002 by SourceDoc v0.10, the automated source code documenter.