14.7 FMod commands

These commands are the interface to the fmod library (Music and Sound Effect System). Include the file Scripts\Common\fmod.r for the REBOL definitions.

 

MUSICPLAY   (CHAR)FileName   (UINT)Flags
Play a music file that can be in  .MOD (ProTracker/FastTracker modules), .S3M (ScreamTracker 3 modules), .XM (FastTracker 2 modules), .IT (Impulse Tracker modules), .MID (MIDI files), .RMI (MIDI files), .SGT (DirectMusic segment files) and .FSB (FMOD Sample Bank files) format.

Parameters:
FileName    File to play.
Flags Fmod initialization flags (see SONGPLAY).

Return values:
Error code if it fails.

Example:
MUSICPLAY    "MyMusic.mid"

See also:
SONGPLAY, MUSICSTOP.


MUSICSTOP
Stop the music started with MUSICPLAY.

Parameters:
None.

Return values:
Error code if it fails.

Example:
SONGSTOP

See also:
MUSICPLAY.


SONGPLAY   (CHAR)FileName   (UINT)Flags
Play a music file that can be in MPEG layer 2/3, Wav (using ACM codecs), WMA, ASF and RAW format.

Parameters:
FileName   

File to play.

Flags Fmod initialization flags.
Flag Value Description
FSOUND_LOOP_OFF 1

For non looping samples.

FSOUND_LOOP_NORMAL 2

For forward looping samples.

FSOUND_LOOP_BIDI 4

For bidirectional looping samples. (no effect if in hardware).

FSOUND_8BITS 8

For 8 bit samples.

FSOUND_16BITS 16

For 16 bit samples.

FSOUND_MONO 32

For mono samples.

FSOUND_STEREO 64

For stereo samples.

FSOUND_UNSIGNED 128

For user created source data containing unsigned samples.

FSOUND_SIGNED 256

For user created source data containing signed data.

FSOUND_DELTA 512

For user created source data stored as delta values.

FSOUND_IT214 1024

For user created source data stored using IT214 compression.

FSOUND_IT215 2048

For user created source data stored using IT215 compression.

FSOUND_HW3D 4096

Attempts to make samples use 3d hardware acceleration. (if the card supports it).

FSOUND_2D 8192

Ignores any 3d processing. Overrides FSOUND_HW3D. Located in software.

FSOUND_STREAMABLE 16384

For a streamomg sound where you feed the data to it. If you dont supply this sound may come out corrupted. (only affects a3d output).

FSOUND_LOADMEMORY 32768

"name" will be interpreted as a pointer to data for streaming and samples.

FSOUND_LOADRAW 65536

Will ignore file format and treat as raw pcm.

FSOUND_MPEGACCURATE 131072

For FSOUND_Stream_OpenFile - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime. WARNING, see FSOUND_Stream_OpenFile for inital opening time performance issues.

FSOUND_FORCEMONO 262144

For forcing stereo streams and samples to be mono - needed if using FSOUND_HW3D and stereo data - incurs a small speed hit for streams.

FSOUND_HW2D 524288

2D hardware sounds. allows hardware specific effects.

FSOUND_ENABLEFX 1048576

Allows DX8 FX to be played back on a sound. Requires DirectX 8 - Note these sounds cannot be played more than once, be 8 bit, be less than a certain size, or have a changing frequency.

Return values:
Error code if it fails.

Example:
SONGPLAY    "MyMusic.mp3"

See also:
SONGSTOP, SONGVOL.


SONGSTOP
Stop the song streaming.

Parameters:
None.

Return values:
Error code if it fails.

Example:
SONGSTOP

See also:
SONGPLAY, SONGVOL.


SONGVOL   (UINT)Volume
Set the volume.

Parameters:
Volume    Play volume (0 <= Volume <= 255)..

Return values:
Error code if it fails.

Example:
SONGVOL    128

See also:
SONGPLAY, SONGSTOP.


Back to the command index