Previous Topic Index Next Topic
[API function]

FSOUND_Stream_PlayEx

Extended featured version of FSOUND_Stream_Play.
Added functionality includes the ability to start the stream paused. This allows attributes
of a stream channel to be set freely before the stream actually starts playing, until FSOUND_SetPaused(FALSE) is used.
Also added is the ability to associate the stream channel to a specified DSP unit. This allows
the user to 'group' channels into seperate DSP units, which allows effects to be inserted
between these 'groups', and allow various things like having one group affected by reverb (wet mix) and another group of
channels unaffected (dry). This is useful to seperate things like music from being affected
by DSP effects, while other sound effects are.

int F_API FSOUND_Stream_PlayEx(
int channel,
FSOUND_STREAM *stream,
FSOUND_DSPUNIT *dspunit,
signed char paused
);

Parameters

channel 0+
The absolute channel number in the channel pool.
Remember software channels come first, followed by hardware channels.
You cannot play a software sample on a hardware channel and vice versa.
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 an EQUAL or LOWER priority
than the sample to be played.
stream Pointer to the already opened stream to be played.
dspunit Pointer to a dsp unit to attach the channel to.
paused Start the stream paused or not. Pausing the stream channel allows attributes to be set before it is unpaused.

Return Value

On success, a 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_SetPan(channel, FSOUND_STEREOPAN) is recommended for this which will center the stream 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. (note WMA/ASF/Internet streaming limitations)
--------
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_SetPan , FSOUND_SetPaused , FSOUND_SetReserved , FSOUND_SetVolume , FSOUND_Stream_Close , FSOUND_Stream_Create , FSOUND_Stream_OpenFile , FSOUND_Stream_Play , 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.