PlayStation 2 only - FSOUND_USECORE0, FSOUND_USECORE1, FSOUND_LOADMEMORYIOP
---------
See flag descriptions for what these do.
]
*/
#define FSOUND_LOOP_OFF 0x00000001 /* For non looping samples. */
#define FSOUND_LOOP_NORMAL 0x00000002 /* For forward looping samples. */
#define FSOUND_LOOP_BIDI 0x00000004 /* For bidirectional looping samples. (no effect if in hardware). */
#define FSOUND_8BITS 0x00000008 /* For 8 bit samples. */
#define FSOUND_16BITS 0x00000010 /* For 16 bit samples. */
#define FSOUND_MONO 0x00000020 /* For mono samples. */
#define FSOUND_STEREO 0x00000040 /* For stereo samples. */
#define FSOUND_UNSIGNED 0x00000080 /* For user created source data containing unsigned samples. */
#define FSOUND_SIGNED 0x00000100 /* For user created source data containing signed data. */
#define FSOUND_DELTA 0x00000200 /* For user created source data stored as delta values. */
#define FSOUND_IT214 0x00000400 /* For user created source data stored using IT214 compression. */
#define FSOUND_IT215 0x00000800 /* For user created source data stored using IT215 compression. */
#define FSOUND_HW3D 0x00001000 /* Attempts to make samples use 3d hardware acceleration. (if the card supports it) */
#define FSOUND_2D 0x00002000 /* Tells software (not hardware) based sample not to be included in 3d processing. */
#define FSOUND_STREAMABLE 0x00004000 /* For a streamimg sound where you feed the data to it. */
#define FSOUND_LOADMEMORY 0x00008000 /* "name" will be interpreted as a pointer to data for streaming and samples. */
#define FSOUND_LOADRAW 0x00010000 /* Will ignore file format and treat as raw pcm. */
#define FSOUND_MPEGACCURATE 0x00020000 /* For FSOUND_Stream_Open - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime. WARNING, see FSOUND_Stream_Open for inital opening time performance issues. */
#define FSOUND_FORCEMONO 0x00040000 /* For forcing stereo streams and samples to be mono - needed if using FSOUND_HW3D and stereo data - incurs a small speed hit for streams */
#define FSOUND_ENABLEFX 0x00100000 /* 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 */
#define FSOUND_MPEGHALFRATE 0x00200000 /* For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution */
#define FSOUND_IMAADPCM 0x00400000 /* Contents are stored compressed as IMA ADPCM */
#define FSOUND_VAG 0x00800000 /* For PS2 only - Contents are compressed as Sony VAG format */
#define FSOUND_NONBLOCKING 0x01000000 /* For FSOUND_Stream_Open/FMUSIC_LoadSong - Causes stream or music to open in the background and not block the foreground app. See FSOUND_Stream_GetOpenState or FMUSIC_GetOpenState to determine when it IS ready. */
#define FSOUND_GCADPCM 0x02000000 /* For Gamecube only - Contents are compressed as Gamecube DSP-ADPCM format */
#define FSOUND_MULTICHANNEL 0x04000000 /* For PS2 and Gamecube only - Contents are interleaved into a multi-channel (more than stereo) format */
#define FSOUND_USECORE0 0x08000000 /* For PS2 only - Sample/Stream is forced to use hardware voices 00-23 */
#define FSOUND_USECORE1 0x10000000 /* For PS2 only - Sample/Stream is forced to use hardware voices 24-47 */
#define FSOUND_LOADMEMORYIOP 0x20000000 /* For PS2 only - "name" will be interpreted as a pointer to data for streaming and samples. The address provided will be an IOP address */
#define FSOUND_IGNORETAGS 0x40000000 /* Skips id3v2 etc tag checks when opening a stream, to reduce seek/read overhead when opening files (helps with CD performance) */
#define FSOUND_STREAM_NET 0x80000000 /* Specifies an internet stream */
Playback method for a CD Audio track, with FSOUND_CD_SetPlayMode
[SEE_ALSO]
FSOUND_CD_SetPlayMode
FSOUND_CD_Play
]
*/
#define FSOUND_CD_PLAYCONTINUOUS 0 /* Starts from the current track and plays to end of CD. */
#define FSOUND_CD_PLAYONCE 1 /* Plays the specified track then stops. */
#define FSOUND_CD_PLAYLOOPED 2 /* Plays the specified track looped, forever until stopped manually. */
#define FSOUND_CD_PLAYRANDOM 3 /* Plays tracks in random order */
/* [DEFINE_END] */
/*
[DEFINE_START]
[
[NAME]
FSOUND_MISC_VALUES
[DESCRIPTION]
Miscellaneous values for FMOD functions.
[SEE_ALSO]
FSOUND_PlaySound
FSOUND_PlaySoundEx
FSOUND_Sample_Alloc
FSOUND_Sample_Load
FSOUND_SetPan
]
*/
#define FSOUND_FREE -1 /* value to play on any free channel, or to allocate a sample in a free sample slot. */
#define FSOUND_UNMANAGED -2 /* value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot. */
#define FSOUND_ALL -3 /* for a channel index , this flag will affect ALL channels available! Not supported by every function. */
#define FSOUND_STEREOPAN -1 /* value for FSOUND_SetPan so that stereo sounds are not played at half volume. See FSOUND_SetPan for more on this. */
#define FSOUND_SYSTEMCHANNEL -1000 /* special 'channel' ID for all channel based functions that want to alter the global FSOUND software mixing output channel */
#define FSOUND_SYSTEMSAMPLE -1000 /* special 'sample' ID for all sample based functions that want to alter the global FSOUND software mixing output sample */
/* [DEFINE_END] */
/*
[STRUCTURE]
[
[DESCRIPTION]
Structure defining a reverb environment.
For more indepth descriptions of the reverb properties under win32, please see the EAX2 and EAX3
documentation at http://developer.creative.com/ under the 'downloads' section.
If they do not have the EAX3 documentation, then most information can be attained from
the EAX2 documentation, as EAX3 only adds some more parameters and functionality on top of EAX2.
Note the default reverb properties are the same as the FSOUND_PRESET_GENERIC preset.
Note that integer values that typically range from -10,000 to 1000 are represented in decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear.
PORTABILITY: Each member has the platform it supports in braces ie (win32/xbox).
Some reverb parameters are only supported in win32 and some only on xbox. If all parameters are set then the reverb should product a similar effect on either platform.
The numerical values listed below are the maximum, minimum and default values for each variable respectively.
[SEE_ALSO]
FSOUND_Reverb_SetProperties
FSOUND_Reverb_GetProperties
FSOUND_REVERB_PRESETS
FSOUND_REVERB_FLAGS
]
*/
typedef struct _FSOUND_REVERB_PROPERTIES /* MIN MAX DEFAULT DESCRIPTION */
{
unsigned int Environment; /* 0 , 25 , 0 , sets all listener properties (WIN32/PS2 only) */
FSOUND_SPEAKERMODE_PROLOGIC2, /* Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 doesnt support interior panning, but supports 48 voices simultaneously. */
FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR /* Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 does support interior panning, but only supports 24 voices simultaneously. */
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_INIT_FLAGS
[DESCRIPTION]
Initialization flags. Use them with FSOUND_Init in the flags parameter to change various behaviour.
FSOUND_INIT_ENABLESYSTEMCHANNELFX Is an init mode which enables the FSOUND mixer buffer to be affected by DirectX 8 effects.
Note that due to limitations of DirectSound, FSOUND_Init may fail if this is enabled because the buffersize is too small.
This can be fixed with FSOUND_SetBufferSize. Increase the BufferSize until it works.
When it is enabled you can use the FSOUND_FX api, and use FSOUND_SYSTEMCHANNEL as the channel id when setting parameters.
[SEE_ALSO]
FSOUND_Init
]
*/
#define FSOUND_INIT_USEDEFAULTMIDISYNTH 0x0001 /* Win32 only - Causes MIDI playback to force software decoding. */
#define FSOUND_INIT_GLOBALFOCUS 0x0002 /* Win32 only - For DirectSound output - sound is not muted when window is out of focus. */
#define FSOUND_INIT_ENABLESYSTEMCHANNELFX 0x0004 /* Win32 only - For DirectSound output - Allows FSOUND_FX api to be used on global software mixer output! (use FSOUND_SYSTEMCHANNEL as channel id) */
#define FSOUND_INIT_ACCURATEVULEVELS 0x0008 /* This latency adjusts FSOUND_GetCurrentLevels, but incurs a small cpu and memory hit */
#define FSOUND_INIT_PS2_DISABLECORE0REVERB 0x0010 /* PS2 only - Disable reverb on CORE 0 (SPU2 voices 00-23) to regain SRAM */
#define FSOUND_INIT_PS2_DISABLECORE1REVERB 0x0020 /* PS2 only - Disable reverb on CORE 1 (SPU2 voices 24-47) to regain SRAM */
#define FSOUND_INIT_PS2_SWAPDMACORES 0x0040 /* PS2 only - By default FMOD uses DMA CH0 for mixing, CH1 for uploads, this flag swaps them around */
#define FSOUND_INIT_DONTLATENCYADJUST 0x0080 /* Callbacks are not latency adjusted, and are called at mix time. Also information functions are immediate */
#define FSOUND_INIT_STREAM_FROM_MAIN_THREAD 0x0200 /* Turns off fmod streamer thread, and makes streaming update from FSOUND_Update called by the user */
#define FSOUND_INIT_PS2_USEVOLUMERAMPING 0x0400 /* PS2 only - Turns on volume ramping system to remove hardware clicks. */
#define FSOUND_INIT_DSOUND_DEFERRED 0x0800 /* Win32 only - For DirectSound output. 3D commands are batched together and executed at FSOUND_Update. */
#define FSOUND_INIT_DSOUND_HRTF_LIGHT 0x1000 /* Win32 only - For DirectSound output. FSOUND_HW3D buffers use a slightly higher quality algorithm when 3d hardware acceleration is not present. */
#define FSOUND_INIT_DSOUND_HRTF_FULL 0x2000 /* Win32 only - For DirectSound output. FSOUND_HW3D buffers use full quality 3d playback when 3d hardware acceleration is not present. */
#define FSOUND_INIT_XBOX_REMOVEHEADROOM 0x4000 /* XBox only - By default directsound attenuates all sound by 6db to avoid clipping/distortion. CAUTION. If you use this flag you are responsible for the final mix to make sure clipping / distortion doesn't happen. */
#define FSOUND_INIT_PSP_SILENCEONUNDERRUN 0x8000 /* PSP only - If streams skip / stutter when device is powered on, either increase stream buffersize, or use this flag instead to play silence while the UMD is recovering. */
/* [DEFINE_END] */
/*
[ENUM]
[
[DESCRIPTION]
Status values for internet streams. Use FSOUND_Stream_Net_GetStatus to get the current status of an internet stream.
FSOUND_STREAM_NET_CONNECTING, /* Stream is connecting to remote host */
FSOUND_STREAM_NET_BUFFERING, /* Stream is buffering data */
FSOUND_STREAM_NET_READY, /* Stream is ready to play */
FSOUND_STREAM_NET_ERROR /* Stream has suffered a fatal error */
};
/*
[ENUM]
[
[DESCRIPTION]
Describes the type of a particular tag field.
[SEE_ALSO]
FSOUND_Stream_GetNumTagFields
FSOUND_Stream_GetTagField
FSOUND_Stream_FindTagField
]
*/
enum FSOUND_TAGFIELD_TYPE
{
FSOUND_TAGFIELD_VORBISCOMMENT = 0, /* A vorbis comment */
FSOUND_TAGFIELD_ID3V1, /* Part of an ID3v1 tag */
FSOUND_TAGFIELD_ID3V2, /* An ID3v2 frame */
FSOUND_TAGFIELD_SHOUTCAST, /* A SHOUTcast header line */
FSOUND_TAGFIELD_ICECAST, /* An Icecast header line */
FSOUND_TAGFIELD_ASF /* An Advanced Streaming Format header line */
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_STATUS_FLAGS
[DESCRIPTION]
These values describe the protocol and format of an internet stream. Use FSOUND_Stream_Net_GetStatus to retrieve this information for an open internet stream.
[SEE_ALSO]
FSOUND_Stream_Net_GetStatus
]
*/
#define FSOUND_PROTOCOL_SHOUTCAST 0x00000001
#define FSOUND_PROTOCOL_ICECAST 0x00000002
#define FSOUND_PROTOCOL_HTTP 0x00000004
#define FSOUND_FORMAT_MPEG 0x00010000
#define FSOUND_FORMAT_OGGVORBIS 0x00020000
/* [DEFINE_END] */
/*
[STRUCTURE]
[
[DESCRIPTION]
Structure defining a CD table of contents. This structure is returned as a tag from FSOUND_Stream_FindTagField when the tag name "CD_TOC" is specified.
Note: All tracks on the CD - including data tracks- will be represented in this structure so it's use for anything other than generating disc id information is not recommended.
See the cdda example program for info on retrieving and using this structure.
[SEE_ALSO]
FSOUND_Stream_Open
FSOUND_Stream_FindTagField
]
*/
typedef struct _FSOUND_TOC_TAG
{
char name[4]; /* The string "TOC", just in case this structure is accidentally treated as a string */
int numtracks; /* The number of tracks on the CD */
int min[100]; /* The start offset of each track in minutes */
int sec[100]; /* The start offset of each track in seconds */
int frame[100]; /* The start offset of each track in frames */
DLL_API signed char F_API FSOUND_Sample_Upload(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode);
DLL_API signed char F_API FSOUND_Sample_Lock(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
DLL_API signed char F_API FSOUND_Sample_Unlock(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
/*
Sample control functions
*/
DLL_API signed char F_API FSOUND_Sample_SetMode(FSOUND_SAMPLE *sptr, unsigned int mode);
DLL_API signed char F_API FSOUND_Sample_SetLoopPoints(FSOUND_SAMPLE *sptr, int loopstart, int loopend);
DLL_API signed char F_API FSOUND_Sample_SetDefaults(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri);
DLL_API signed char F_API FSOUND_Sample_SetDefaultsEx(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan);
DLL_API signed char F_API FSOUND_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min, float max);
DLL_API signed char F_API FSOUND_Sample_SetMaxPlaybacks(FSOUND_SAMPLE *sptr, int max);
DLL_API unsigned int F_API FSOUND_Sample_GetLength(FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FSOUND_Sample_GetLoopPoints(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend);
DLL_API signed char F_API FSOUND_Sample_GetDefaults(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri);
DLL_API signed char F_API FSOUND_Sample_GetDefaultsEx(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri, int *varfreq, int *varvol, int *varpan);
DLL_API unsigned int F_API FSOUND_Sample_GetMode(FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FSOUND_Sample_GetMinMaxDistance(FSOUND_SAMPLE *sptr, float *min, float *max);
/* ============================ */
/* Channel control functions. */
/* ============================ */
/*
Playing and stopping sounds.
Note : Use FSOUND_FREE as the 'channel' variable, to let FMOD pick a free channel for you.
Use FSOUND_ALL as the 'channel' variable to control ALL channels with one function call!
*/
DLL_API int F_API FSOUND_PlaySound(int channel, FSOUND_SAMPLE *sptr);
DLL_API int F_API FSOUND_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
DLL_API signed char F_API FSOUND_StopSound(int channel);
/*
Functions to control playback of a channel.
Note : FSOUND_ALL can be used on most of these functions as a channel value.
*/
DLL_API signed char F_API FSOUND_SetFrequency(int channel, int freq);
DLL_API signed char F_API FSOUND_SetVolume(int channel, int vol);
DLL_API signed char F_API FSOUND_SetVolumeAbsolute(int channel, int vol);
DLL_API signed char F_API FSOUND_SetPan(int channel, int pan);
DLL_API signed char F_API FSOUND_SetSurround(int channel, signed char surround);
DLL_API signed char F_API FSOUND_SetMute(int channel, signed char mute);
DLL_API signed char F_API FSOUND_SetPriority(int channel, int priority);
DLL_API signed char F_API FSOUND_SetReserved(int channel, signed char reserved);
DLL_API signed char F_API FSOUND_SetPaused(int channel, signed char paused);
DLL_API signed char F_API FSOUND_SetLoopMode(int channel, unsigned int loopmode);
DLL_API signed char F_API FSOUND_SetCurrentPosition(int channel, unsigned int offset);
Note for the spectrum analysis function to work, you have to enable the FFT DSP unit with
the following code FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE);
It is off by default to save cpu usage.
*/
DLL_API signed char F_API FSOUND_DSP_MixBuffers(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode);
DLL_API void F_API FSOUND_DSP_ClearMixBuffer();
DLL_API int F_API FSOUND_DSP_GetBufferLength(); /* Length of each DSP update */
DLL_API int F_API FSOUND_DSP_GetBufferLengthTotal(); /* Total buffer length due to FSOUND_SetBufferSize */
DLL_API float * F_API FSOUND_DSP_GetSpectrum(); /* Array of 512 floats - call FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE)) for this to work. */
DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSongEx(const char *name_or_data, int offset, int length, unsigned int mode, const int *samplelist, int samplelistnum);
DLL_API int F_API FMUSIC_GetOpenState(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_FreeSong(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_PlaySong(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_StopSong(FMUSIC_MODULE *mod);
DLL_API void F_API FMUSIC_StopAllSongs();
DLL_API signed char F_API FMUSIC_SetZxxCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback);
DLL_API signed char F_API FMUSIC_SetRowCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep);
DLL_API signed char F_API FMUSIC_SetOrderCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep);
DLL_API signed char F_API FMUSIC_SetInstCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument);
DLL_API signed char F_API FMUSIC_SetSample(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FMUSIC_SetUserData(FMUSIC_MODULE *mod, void *userdata);
DLL_API signed char F_API FMUSIC_OptimizeChannels(FMUSIC_MODULE *mod, int maxchannels, int minvolume);
/*
Runtime song functions.
*/
DLL_API signed char F_API FMUSIC_SetReverb(signed char reverb); /* MIDI only */
DLL_API signed char F_API FMUSIC_SetLooping(FMUSIC_MODULE *mod, signed char looping);
DLL_API signed char F_API FMUSIC_SetOrder(FMUSIC_MODULE *mod, int order);
DLL_API signed char F_API FMUSIC_SetPaused(FMUSIC_MODULE *mod, signed char pause);
DLL_API signed char F_API FMUSIC_SetMasterVolume(FMUSIC_MODULE *mod, int volume);
DLL_API signed char F_API FMUSIC_SetMasterSpeed(FMUSIC_MODULE *mode, float speed);
DLL_API signed char F_API FMUSIC_SetPanSeperation(FMUSIC_MODULE *mod, float pansep);