Previous Topic Index Next Topic
[API function]

FSOUND_Stream_Open

Opens an audio file/url ready for streaming.
This opens the file in preparation for playback in real-time, without needing to decode the whole file into memory first.

FSOUND_STREAM * F_API FSOUND_Stream_Open(
const char *name_or_data,
unsigned int mode,
int offset,
int length
);

Parameters

name_or_data Name of the file to open, or pointer to data if FSOUND_LOADMEMORY is used.
mode Simple description of how to play the file. For all formats except raw PCM,
FSOUND_LOOP*, FSOUND_HW3D, FSOUND_HW2D, FSOUND_2D, FSOUND_LOADMEMORY, FSOUND_LOADRAW, FSOUND_MPEGACCURATE, FSOUND_NONBLOCKING flags are the only ones supported.
offset Optional. 0 by default. If > 0, this value is used to specify an offset in a file, so fmod will seek before opening. length must also be specified if this value is used.
length Optional. 0 by default. If > 0, this value is used to specify the length of a memory block when using FSOUND_LOADMEMORY, or it is the length of a file or file segment if the offset parameter is used. On PlayStation 2 this must be 16 byte aligned for memory loading.

Return Value

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

Remarks

WAV support supports windows codec compressed WAV files.
--------------
NOTE : WMA/ASF streams are a limited implementation because of the way the formats work. Note the following limitations
- Multiple WMA/ASF streams streams are not supported.
- Playing WMA/ASF streams do not run through the software engine, and will not show up in the DSP output or spectrum.
- Streaming WMA/ASF from memory is not supported.
- WMA/ASF stream playback will always comes from primary sound device.
- WMA/ASF streams cannot loop, the flag will be ignored.
--------------
FSOUND_MPEGACCURATE is to be used cautiously. To open a file with this mode turned on, it has to scan the whole MP3 first. This can take several seconds if the file is big, or the harddisk/cpu is slow.
A way to speed up this process would be to load the compressed mp3 into memory first, and use the FSOUND_LOADMEMORY flag with this function.
--------------
NOTE : Internet stream limitations
- URLs must start with "http://".
- The only supported formats for HTTP streams are MP3 (must have .mp3 extension) and OggVorbis (must have .ogg extension).
--------------
Note, on PlayStation 2 you cannot use FSOUND_LOADMEMORY, you may use FSOUND_LOADMEMORYIOP though.
--------------
When opening with the FSOUND_NONBLOCKING flag, this function always succeeds at the point of being called.
It will always return a valid channel handle, even though the file might fail to open. To determine any error in non blocking mode use FSOUND_Stream_GetOpenState.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2, GameCube

See Also

FSOUND_MODES , FSOUND_Stream_Close , FSOUND_Stream_GetLength , FSOUND_Stream_GetLengthMs , FSOUND_Stream_GetOpenState , FSOUND_Stream_Net_GetBufferProperties , FSOUND_Stream_Net_GetInfo , FSOUND_Stream_Net_GetLastServerStatus , FSOUND_Stream_Net_GetStatus , FSOUND_Stream_Net_SetBufferProperties , FSOUND_Stream_Net_SetMetadataCallback , FSOUND_Stream_Net_SetProxy , FSOUND_Stream_Play , FSOUND_Stream_PlayEx , FSOUND_Stream_SetBufferSize , FSOUND_Stream_Stop

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Sep 05 18:50:23 2003 by SourceDoc v0.10, the automated source code documenter.