📄 fmod.h
字号:
#define FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO 0x00000001 /* Automatic setting of 'Direct' due to distance from listener */
#define FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO 0x00000002 /* Automatic setting of 'Room' due to distance from listener */
#define FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO 0x00000004 /* Automatic setting of 'RoomHF' due to distance from listener */
#define FSOUND_REVERB_CHANNELFLAGS_DEFAULT (FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO | \
FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO| \
FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO)
/* [DEFINE_END] */
/*
[DEFINE_START]
[
[NAME]
FSOUND_GEOMETRY_MODES
[DESCRIPTION]
Geometry flags, used as the mode flag in FSOUND_Geometry_AddPolygon
[SEE_ALSO]
FSOUND_Geometry_AddPolygon
]
*/
#define FSOUND_GEOMETRY_NORMAL 0x00 /* Default geometry type. Occluding polygon */
#define FSOUND_GEOMETRY_REFLECTIVE 0x01 /* This polygon is reflective */
#define FSOUND_GEOMETRY_OPENING 0x02 /* Overlays a transparency over the previous polygon. The openingfactor value supplied is copied internally. */
#define FSOUND_GEOMETRY_OPENING_REFERENCE 0x04 /* Overlays a transparency over the previous polygon. The openingfactor supplied is pointed to (for access when building a list) */
/* [DEFINE_END] */
/*
[ENUM]
[
[DESCRIPTION]
These values are used with FSOUND_FX_Enable to enable DirectX 8 FX for a channel.
[SEE_ALSO]
FSOUND_FX_Enable
FSOUND_FX_SetChorus
FSOUND_FX_SetCompressor
FSOUND_FX_SetDistortion
FSOUND_FX_SetEcho
FSOUND_FX_SetFlanger
FSOUND_FX_SetGargle
FSOUND_FX_SetI3DL2Reverb
FSOUND_FX_SetParamEQ
FSOUND_FX_SetWavesReverb
]
*/
enum FSOUND_FX_MODES
{
FSOUND_FX_CHORUS,
FSOUND_FX_COMPRESSOR,
FSOUND_FX_DISTORTION,
FSOUND_FX_ECHO,
FSOUND_FX_FLANGER,
FSOUND_FX_GARGLE,
FSOUND_FX_I3DL2REVERB,
FSOUND_FX_PARAMEQ,
FSOUND_FX_WAVES_REVERB
};
/*
[ENUM]
[
[DESCRIPTION]
These are speaker types defined for use with the FSOUND_SetSpeakerMode command.
Note - Only works with FSOUND_OUTPUT_DSOUND output mode.
[SEE_ALSO]
FSOUND_SetSpeakerMode
]
*/
enum FSOUND_SPEAKERMODES
{
FSOUND_SPEAKERMODE_5POINT1, /* The audio is played through a speaker arrangement of surround speakers with a subwoofer. */
FSOUND_SPEAKERMODE_HEADPHONE, /* The speakers are headphones. */
FSOUND_SPEAKERMODE_MONO, /* The speakers are monaural. */
FSOUND_SPEAKERMODE_QUAD, /* The speakers are quadraphonic. */
FSOUND_SPEAKERMODE_STEREO, /* The speakers are stereo (default value). */
FSOUND_SPEAKERMODE_SURROUND /* The speakers are surround sound. */
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_INIT_FLAGS
[DESCRIPTION]
Initialization flags. Use them with FSOUND_Init in the flags parameter to change various behaviour.
FSOUND_INIT_ENABLEOUTPUTFX 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 0x01 /* Causes MIDI playback to force software decoding. */
#define FSOUND_INIT_GLOBALFOCUS 0x02 /* For DirectSound output - sound is not muted when window is out of focus. */
#define FSOUND_INIT_ENABLEOUTPUTFX 0x04 /* For DirectSound output - Allows FSOUND_FX api to be used on global software mixer output! */
#define FSOUND_INIT_ACCURATEGETCURRENTVU 0x08 /* This latency adjusts FSOUND_GetCurrentVU, but incurs a cpu and very small memory hit */
/* [DEFINE_END] */
/* ========================================================================================== */
/* FUNCTION PROTOTYPES */
/* ========================================================================================== */
#ifdef __cplusplus
extern "C" {
#endif
/* ================================== */
/* Initialization / Global functions. */
/* ================================== */
/*
PRE - FSOUND_Init functions. These can't be called after FSOUND_Init is
called (they will fail). They set up FMOD system functionality.
*/
DLL_API signed char F_API FSOUND_SetOutput(int outputtype);
DLL_API signed char F_API FSOUND_SetDriver(int driver);
DLL_API signed char F_API FSOUND_SetMixer(int mixer);
DLL_API signed char F_API FSOUND_SetBufferSize(int len_ms);
DLL_API signed char F_API FSOUND_SetHWND(void *hwnd);
DLL_API signed char F_API FSOUND_SetMinHardwareChannels(int min);
DLL_API signed char F_API FSOUND_SetMaxHardwareChannels(int max);
DLL_API signed char F_API FSOUND_SetMemorySystem(void *pool, int poollen,
FSOUND_ALLOCCALLBACK useralloc,
FSOUND_REALLOCCALLBACK userrealloc,
FSOUND_FREECALLBACK userfree);
/*
Main initialization / closedown functions.
Note : Use FSOUND_INIT_USEDEFAULTMIDISYNTH with FSOUND_Init for software override
with MIDI playback.
: Use FSOUND_INIT_GLOBALFOCUS with FSOUND_Init to make sound audible no matter
which window is in focus. (FSOUND_OUTPUT_DSOUND only)
*/
DLL_API signed char F_API FSOUND_Init(int mixrate, int maxsoftwarechannels, unsigned int flags);
DLL_API void F_API FSOUND_Close();
/*
Runtime system level functions
*/
DLL_API void F_API FSOUND_SetSpeakerMode(unsigned int speakermode);
DLL_API void F_API FSOUND_SetSFXMasterVolume(int volume);
DLL_API void F_API FSOUND_SetPanSeperation(float pansep);
DLL_API void F_API FSOUND_File_SetCallbacks(FSOUND_OPENCALLBACK useropen,
FSOUND_CLOSECALLBACK userclose,
FSOUND_READCALLBACK userread,
FSOUND_SEEKCALLBACK userseek,
FSOUND_TELLCALLBACK usertell);
/*
System information functions.
*/
DLL_API int F_API FSOUND_GetError();
DLL_API float F_API FSOUND_GetVersion();
DLL_API int F_API FSOUND_GetOutput();
DLL_API void * F_API FSOUND_GetOutputHandle();
DLL_API int F_API FSOUND_GetDriver();
DLL_API int F_API FSOUND_GetMixer();
DLL_API int F_API FSOUND_GetNumDrivers();
DLL_API signed char * F_API FSOUND_GetDriverName(int id);
DLL_API signed char F_API FSOUND_GetDriverCaps(int id, unsigned int *caps);
DLL_API int F_API FSOUND_GetOutputRate();
DLL_API int F_API FSOUND_GetMaxChannels();
DLL_API int F_API FSOUND_GetMaxSamples();
DLL_API int F_API FSOUND_GetSFXMasterVolume();
DLL_API int F_API FSOUND_GetNumHardwareChannels();
DLL_API int F_API FSOUND_GetChannelsPlaying();
DLL_API float F_API FSOUND_GetCPUUsage();
DLL_API void F_API FSOUND_GetMemoryStats(unsigned int *currentalloced, unsigned int *maxalloced);
/* =================================== */
/* Sample management / load functions. */
/* =================================== */
/*
Sample creation and management functions
Note : Use FSOUND_LOADMEMORY flag with FSOUND_Sample_Load to load from memory.
Use FSOUND_LOADRAW flag with FSOUND_Sample_Load to treat as as raw pcm data.
*/
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Load(int index, const char *name_or_data, unsigned int mode, int memlength);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Alloc(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri);
DLL_API void F_API FSOUND_Sample_Free(FSOUND_SAMPLE *sptr);
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_SetLoopMode(FSOUND_SAMPLE *sptr, unsigned int loopmode);
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_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min, float max);
/*
Sample information functions
*/
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Get(int sampno);
DLL_API char * F_API FSOUND_Sample_GetName(FSOUND_SAMPLE *sptr);
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 unsigned int F_API FSOUND_Sample_GetMode(FSOUND_SAMPLE *sptr);
/* ============================ */
/* 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);
/*
Functions to control DX8 only effects processing.
- FX enabled samples can only be played once at a time, not multiple times at once.
- Sounds have to be created with FSOUND_HW2D or FSOUND_HW3D for this to work.
- FSOUND_INIT_ENABLEOUTPUTFX can be used to apply hardware effect processing to the
global mixed output of FMOD's software channels.
- FSOUND_FX_Enable returns an FX handle that you can use to alter fx parameters.
- FSOUND_FX_Enable can be called multiple times in a row, even on the same FX type,
it will return a unique handle for each FX.
- FSOUND_FX_Enable cannot be called if the sound is playing or locked.
- Stopping or starting a sound resets all FX and they must be re-enabled each time
if this happens.
*/
DLL_API int F_API FSOUND_FX_Enable(int channel, unsigned int fx); /* See FSOUND_FX_MODES */
DLL_API signed char F_API FSOUND_FX_SetChorus(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -