The macro BSF OPEN creates and/or opens a sound file. The function returns 0 if the sound file was opened/created. In this case the sound file is made to the current sound file and its name (full path) and parameters are stored in the variables CSF and CSFH. If a sound file is already opened, it is only selected and the open-counter is incremented. See Shell Environment for detailed information about CSF and CSFH.
READ |
The file must exist and is opened for read only access. |
WRITE |
The file is opened for read/write access and created if it does not exist. |
AUTO |
The mode READ or WRITE is chosen automatically depending on the file's status. |
CREATE |
A new file is created even if the specified file exists. If an automatic file name is requested (path equals '*'), the mode CREATE is always assumed. The arguments srate, channels, code, type and offset are only used if a new file is created. |
Usage:
BSF OPEN path [; mode; srate; channels; code; type; offset]
Parameters:
path
The sound file path or * for automatic file name (e.g. for temporary files).
mode
The access mode {READ|WRITE|AUTO|CREATE}. See above for more details.
srate
The sampling rate in Hz.
channels
The number of channels.
code
The sample code (PCM8|PCM16|PCM24|PCM32|FLOAT).
type
The file format (ST5|WAVE|BINARY).
offset
The size of the file header in bytes (for type=BINARY).
Result:
0 for success or non-zero error code.