Previous Topic Index Next Topic
[API function]

FSOUND_Stream_OpenFile

Opens a RAW/.WAV/.MP2/.MP3/.OGG/.WMA or .ASF streamable file ready for streaming.

FSOUND_STREAM * F_API FSOUND_Stream_OpenFile(
const char *filename,
unsigned int mode,
int memlength
);

Parameters

filename 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 flags are the only ones supported.
memlength Only used if FSOUND_LOADMEMORY is specified in the mode, otherwise leave as 0.
This specifies the lengh of the memory block in BYTES being passed if FSOUND_LOADMEMORY is used.

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/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 output or spectrum.
- 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.
--------------
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.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2

See Also

FSOUND_MODES , FSOUND_Stream_Close , FSOUND_Stream_GetLength , FSOUND_Stream_GetLengthMs , FSOUND_Stream_GetOpenState , 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 Dec 20 16:31:09 2002 by SourceDoc v0.10, the automated source code documenter.