Initial commit

This commit is contained in:
RaduMCosma
2015-10-30 04:41:37 +02:00
commit ee040bdd71
68 changed files with 24871 additions and 0 deletions

5510
Unity Studio/FMOD/fmod.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,739 @@
/*$ preserve start $*/
/* ========================================================================================== */
/* FMOD Ex - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2014. */
/* */
/* Use this header if you are interested in delving deeper into the FMOD software mixing / */
/* DSP engine. In this header you can find parameter structures for FMOD system reigstered */
/* DSP effects and generators. */
/* */
/* ========================================================================================== */
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace FMOD
{
/*$ preserve end $*/
/*
DSP callbacks
*/
public delegate RESULT DSP_CREATECALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_RELEASECALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_RESETCALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_READCALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, int outchannels);
public delegate RESULT DSP_SETPOSITIONCALLBACK (ref DSP_STATE dsp_state, uint seeklen);
public delegate RESULT DSP_SETPARAMCALLBACK (ref DSP_STATE dsp_state, int index, float val);
public delegate RESULT DSP_GETPARAMCALLBACK (ref DSP_STATE dsp_state, int index, ref float val, StringBuilder valuestr);
public delegate RESULT DSP_DIALOGCALLBACK (ref DSP_STATE dsp_state, IntPtr hwnd, bool show);
/*
[ENUM]
[
[DESCRIPTION]
These definitions can be used for creating FMOD defined special effects or DSP units.
[REMARKS]
To get them to be active, first create the unit, then add it somewhere into the DSP network, either at the front of the network near the soundcard unit to affect the global output (by using System::getDSPHead), or on a single channel (using Channel::getDSPHead).
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
System::createDSPByType
]
*/
public enum DSP_TYPE :int
{
UNKNOWN, /* This unit was created via a non FMOD plugin so has an unknown purpose */
MIXER, /* This unit does nothing but take inputs and mix them together then feed the result to the soundcard unit. */
OSCILLATOR, /* This unit generates sine/square/saw/triangle or noise tones. */
LOWPASS, /* This unit filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time. */
ITLOWPASS, /* This unit filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker, but with limited cutoff range (0 to 8060hz). */
HIGHPASS, /* This unit filters sound using a resonant highpass filter algorithm. */
ECHO, /* This unit produces an echo on the sound and fades out at the desired rate. */
FLANGE, /* This unit produces a flange effect on the sound. */
DISTORTION, /* This unit distorts the sound. */
NORMALIZE, /* This unit normalizes or amplifies the sound to a certain level. */
PARAMEQ, /* This unit attenuates or amplifies a selected frequency range. */
PITCHSHIFT, /* This unit bends the pitch of a sound without changing the speed of playback. */
CHORUS, /* This unit produces a chorus effect on the sound. */
VSTPLUGIN, /* This unit allows the use of Steinberg VST plugins */
WINAMPPLUGIN, /* This unit allows the use of Nullsoft Winamp plugins */
ITECHO, /* This unit produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker. */
COMPRESSOR, /* This unit implements dynamic compression (linked multichannel, wideband) */
SFXREVERB, /* This unit implements SFX reverb */
LOWPASS_SIMPLE, /* This unit filters sound using a simple lowpass with no resonance, but has flexible cutoff and is fast. */
DELAY, /* This unit produces different delays on individual channels of the sound. */
TREMOLO, /* This unit produces a tremolo / chopper effect on the sound. */
LADSPAPLUGIN, /* This unit allows the use of LADSPA standard plugins. */
}
/*
[STRUCTURE]
[
[DESCRIPTION]
[REMARKS]
Members marked with [in] mean the user sets the value before passing it to the function.<br>
Members marked with [out] mean FMOD sets the value to be used after the function exits.<br>
<br>
The step parameter tells the gui or application that the parameter has a certain granularity.<br>
For example in the example of cutoff frequency with a range from 100.0 to 22050.0 you might only want the selection to be in 10hz increments. For this you would simply use 10.0 as the step value.<br>
For a boolean, you can use min = 0.0, max = 1.0, step = 1.0. This way the only possible values are 0.0 and 1.0.<br>
Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>
A step value of 1.0 would simulate integer values only.<br>
A step value of 0.0 would mean the full floating point range is accessable.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
System::createDSP
System::getDSP
]
*/
public struct DSP_PARAMETERDESC
{
public float min; /* [in] Minimum value of the parameter (ie 100.0). */
public float max; /* [in] Maximum value of the parameter (ie 22050.0). */
public float defaultval; /* [in] Default value of parameter. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public char[] name; /* [in] Name of the parameter to be displayed (ie "Cutoff frequency"). */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public char[] label; /* [in] Short string to be put next to value to denote the unit type (ie "hz"). */
public string description; /* [in] Description of the parameter to be displayed as a help item / tooltip for this parameter. */
}
/*
[STRUCTURE]
[
[DESCRIPTION]
Strcture to define the parameters for a DSP unit.
[REMARKS]
Members marked with [in] mean the user sets the value before passing it to the function.<br>
Members marked with [out] mean FMOD sets the value to be used after the function exits.<br>
<br>
There are 2 different ways to change a parameter in this architecture.<br>
One is to use DSP::setParameter / DSP::getParameter. This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.<br>
The other is to use DSP::showConfigDialog. This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
System::createDSP
System::getDSP
]
*/
public struct DSP_DESCRIPTION
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=32)]
public char[] name; /* [in] Name of the unit to be displayed in the network. */
public uint version; /* [in] Plugin writer's version number. */
public int channels; /* [in] Number of channels. Use 0 to process whatever number of channels is currently in the network. >0 would be mostly used if the unit is a unit that only generates sound. */
public DSP_CREATECALLBACK create; /* [in] Create callback. This is called when DSP unit is created. Can be null. */
public DSP_RELEASECALLBACK release; /* [in] Release callback. This is called just before the unit is freed so the user can do any cleanup needed for the unit. Can be null. */
public DSP_RESETCALLBACK reset; /* [in] Reset callback. This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state. Use to avoid clicks or artifacts. */
public DSP_READCALLBACK read; /* [in] Read callback. Processing is done here. Can be null. */
public DSP_SETPOSITIONCALLBACK setposition; /* [in] Setposition callback. This is called if the unit wants to update its position info but not process data. Can be null. */
public int numparameters; /* [in] Number of parameters used in this filter. The user finds this with DSP::getNumParameters */
public DSP_PARAMETERDESC[] paramdesc; /* [in] Variable number of parameter structures. */
public DSP_SETPARAMCALLBACK setparameter; /* [in] This is called when the user calls DSP::setParameter. Can be null. */
public DSP_GETPARAMCALLBACK getparameter; /* [in] This is called when the user calls DSP::getParameter. Can be null. */
public DSP_DIALOGCALLBACK config; /* [in] This is called when the user calls DSP::showConfigDialog. Can be used to display a dialog to configure the filter. Can be null. */
public int configwidth; /* [in] Width of config dialog graphic if there is one. 0 otherwise.*/
public int configheight; /* [in] Height of config dialog graphic if there is one. 0 otherwise.*/
public IntPtr userdata; /* [in] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation. Access via DSP::getUserData. */
}
/*
[STRUCTURE]
[
[DESCRIPTION]
DSP plugin structure that is passed into each callback.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3
[SEE_ALSO]
FMOD_DSP_DESCRIPTION
]
*/
public struct DSP_STATE
{
public IntPtr instance; /* [out] Handle to the DSP hand the user created. Not to be modified. C++ users cast to FMOD::DSP to use. */
public IntPtr plugindata; /* [in] Plugin writer created data the output author wants to attach to this object. */
public ushort speakermask; /* Specifies which speakers the DSP effect is active on */
};
/*
==============================================================================================================
FMOD built in effect parameters.
Use DSP::setParameter with these enums for the 'index' parameter.
==============================================================================================================
*/
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_OSCILLATOR filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_OSCILLATOR
{
TYPE, /* Waveform type. 0 = sine. 1 = square. 2 = sawup. 3 = sawdown. 4 = triangle. 5 = noise. */
RATE /* Frequency of the sinewave in hz. 1.0 to 22000.0. Default = 220.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_LOWPASS filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_LOWPASS
{
CUTOFF, /* Lowpass cutoff frequency in hz. 1.0 to 22000.0. Default = 5000.0. */
RESONANCE /* Lowpass resonance Q value. 1.0 to 10.0. Default = 1.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_ITLOWPASS filter.
This is different to the default FMOD_DSP_TYPE_ITLOWPASS filter in that it uses a different quality algorithm and is
the filter used to produce the correct sounding playback in .IT files.<br>
FMOD Ex's .IT playback uses this filter.<br>
[REMARKS]
Note! This filter actually has a limited cutoff frequency below the specified maximum, due to its limited design,
so for a more open range filter use FMOD_DSP_LOWPASS or if you don't mind not having resonance,
FMOD_DSP_LOWPASS_SIMPLE.<br>
The effective maximum cutoff is about 8060hz.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_ITLOWPASS
{
CUTOFF, /* Lowpass cutoff frequency in hz. 1.0 to 22000.0. Default = 5000.0/ */
RESONANCE /* Lowpass resonance Q value. 0.0 to 127.0. Default = 1.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_HIGHPASS filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_HIGHPASS
{
CUTOFF, /* Highpass cutoff frequency in hz. 10.0 to output 22000.0. Default = 5000.0. */
RESONANCE /* Highpass resonance Q value. 1.0 to 10.0. Default = 1.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_ECHO filter.
[REMARKS]
Note. Every time the delay is changed, the plugin re-allocates the echo buffer. This means the echo will dissapear at that time while it refills its new buffer.<br>
Larger echo delays result in larger amounts of memory allocated.<br>
<br>
'<i>maxchannels</i>' also dictates the amount of memory allocated. By default, the maxchannels value is 0. If FMOD is set to stereo, the echo unit will allocate enough memory for 2 channels. If it is 5.1, it will allocate enough memory for a 6 channel echo, etc.<br>
If the echo effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.<br>
When the echo is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly. It is only in this case where you might want to increase the channel count above the output's channel count.<br>
If a channel echo is set to a lower number than the sound's channel count that is coming in, it will not echo the sound.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_ECHO
{
DELAY, /* Echo delay in ms. 10 to 5000. Default = 500. */
DECAYRATIO, /* Echo decay per delay. 0 to 1. 1.0 = No decay, 0.0 = total decay. Default = 0.5. */
MAXCHANNELS, /* Maximum channels supported. 0 to 16. 0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc. See remarks for more. Default = 0. It is suggested to leave at 0! */
DRYMIX, /* Volume of original signal to pass to output. 0.0 to 1.0. Default = 1.0. */
WETMIX /* Volume of echo signal to pass to output. 0.0 to 1.0. Default = 1.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_DELAY filter.
[REMARKS]
Note. Every time MaxDelay is changed, the plugin re-allocates the delay buffer. This means the delay will dissapear at that time while it refills its new buffer.<br>
A larger MaxDelay results in larger amounts of memory allocated.<br>
Channel delays above MaxDelay will be clipped to MaxDelay and the delay buffer will not be resized.<br>
<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_DELAY
{
CH0, /* Channel #0 Delay in ms. 0 to 10000. Default = 0. */
CH1, /* Channel #1 Delay in ms. 0 to 10000. Default = 0. */
CH2, /* Channel #2 Delay in ms. 0 to 10000. Default = 0. */
CH3, /* Channel #3 Delay in ms. 0 to 10000. Default = 0. */
CH4, /* Channel #4 Delay in ms. 0 to 10000. Default = 0. */
CH5, /* Channel #5 Delay in ms. 0 to 10000. Default = 0. */
CH6, /* Channel #6 Delay in ms. 0 to 10000. Default = 0. */
CH7, /* Channel #7 Delay in ms. 0 to 10000. Default = 0. */
CH8, /* Channel #8 Delay in ms. 0 to 10000. Default = 0. */
CH9, /* Channel #9 Delay in ms. 0 to 10000. Default = 0. */
CH10, /* Channel #10 Delay in ms. 0 to 10000. Default = 0. */
CH11, /* Channel #11 Delay in ms. 0 to 10000. Default = 0. */
CH12, /* Channel #12 Delay in ms. 0 to 10000. Default = 0. */
CH13, /* Channel #13 Delay in ms. 0 to 10000. Default = 0. */
CH14, /* Channel #14 Delay in ms. 0 to 10000. Default = 0. */
CH15, /* Channel #15 Delay in ms. 0 to 10000. Default = 0. */
MAXDELAY, /* Maximum delay in ms. 0 to 1000. Default = 10. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_FLANGE filter.
[REMARKS]
Flange is an effect where the signal is played twice at the same time, and one copy slides back and forth creating a whooshing or flanging effect.<br>
As there are 2 copies of the same signal, by default each signal is given 50% mix, so that the total is not louder than the original unaffected signal.<br>
<br>
Flange depth is a percentage of a 10ms shift from the original signal. Anything above 10ms is not considered flange because to the ear it begins to 'echo' so 10ms is the highest value possible.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_FLANGE
{
DRYMIX, /* Volume of original signal to pass to output. 0.0 to 1.0. Default = 0.45. */
WETMIX, /* Volume of flange signal to pass to output. 0.0 to 1.0. Default = 0.55. */
DEPTH, /* Flange depth. 0.01 to 1.0. Default = 1.0. */
RATE /* Flange speed in hz. 0.0 to 20.0. Default = 0.1. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_TREMOLO filter.
[REMARKS]
The tremolo effect varies the amplitude of a sound. Depending on the settings, this unit can produce a tremolo, chopper or auto-pan effect.<br>
<br>
The shape of the LFO (low freq. oscillator) can morphed between sine, triangle and sawtooth waves using the FMOD_DSP_TREMOLO_SHAPE and FMOD_DSP_TREMOLO_SKEW parameters.<br>
FMOD_DSP_TREMOLO_DUTY and FMOD_DSP_TREMOLO_SQUARE are useful for a chopper-type effect where the first controls the on-time duration and second controls the flatness of the envelope.<br>
FMOD_DSP_TREMOLO_SPREAD varies the LFO phase between channels to get an auto-pan effect. This works best with a sine shape LFO.<br>
The LFO can be synchronized using the FMOD_DSP_TREMOLO_PHASE parameter which sets its instantaneous phase.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_TREMOLO
{
FREQUENCY, /* LFO frequency in Hz. 0.1 to 20. Default = 4. */
DEPTH, /* Tremolo depth. 0 to 1. Default = 0. */
SHAPE, /* LFO shape morph between triangle and sine. 0 to 1. Default = 0. */
SKEW, /* Time-skewing of LFO cycle. -1 to 1. Default = 0. */
DUTY, /* LFO on-time. 0 to 1. Default = 0.5. */
SQUARE, /* Flatness of the LFO shape. 0 to 1. Default = 0. */
PHASE, /* Instantaneous LFO phase. 0 to 1. Default = 0. */
SPREAD /* Rotation / auto-pan effect. -1 to 1. Default = 0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_DISTORTION filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_DISTORTION
{
LEVEL /* Distortion value. 0.0 to 1.0. Default = 0.5. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_NORMALIZE filter.
[REMARKS]
Normalize amplifies the sound based on the maximum peaks within the signal.<br>
For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.<br>
The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.<br>
<br>
Because FMOD is a realtime audio processor, it doesn't have the luxury of knowing the peak for the whole sound (ie it can't see into the future), so it has to process data as it comes in.<br>
To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control. The fadetime parameter can control this.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_NORMALIZE
{
FADETIME, /* Time to ramp the silence to full in ms. 0.0 to 20000.0. Default = 5000.0. */
THRESHHOLD, /* Lower volume range threshold to ignore. 0.0 to 1.0. Default = 0.1. Raise higher to stop amplification of very quiet signals. */
MAXAMP /* Maximum amplification allowed. 1.0 to 100000.0. Default = 20.0. 1.0 = no amplifaction, higher values allow more boost. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_PARAMEQ filter.
[REMARKS]
Parametric EQ is a bandpass filter that attenuates or amplifies a selected frequency and its neighbouring frequencies.<br>
<br>
To create a multi-band EQ create multiple FMOD_DSP_TYPE_PARAMEQ units and set each unit to different frequencies, for example 1000hz, 2000hz, 4000hz, 8000hz, 16000hz with a range of 1 octave each.<br>
<br>
When a frequency has its gain set to 1.0, the sound will be unaffected and represents the original signal exactly.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_PARAMEQ
{
CENTER, /* Frequency center. 20.0 to 22000.0. Default = 8000.0. */
BANDWIDTH, /* Octave range around the center frequency to filter. 0.2 to 5.0. Default = 1.0. */
GAIN /* Frequency Gain. 0.05 to 3.0. Default = 1.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_PITCHSHIFT filter.
[REMARKS]
This pitch shifting unit can be used to change the pitch of a sound without speeding it up or slowing it down.<br>
It can also be used for time stretching or scaling, for example if the pitch was doubled, and the frequency of the sound was halved, the pitch of the sound would sound correct but it would be twice as slow.<br>
<br>
<b>Warning!</b> This filter is very computationally expensive! Similar to a vocoder, it requires several overlapping FFT and IFFT's to produce smooth output, and can require around 440mhz for 1 stereo 48khz signal using the default settings.<br>
Reducing the signal to mono will half the cpu usage, as will the overlap count.<br>
Reducing this will lower audio quality, but what settings to use are largely dependant on the sound being played. A noisy polyphonic signal will need higher overlap and fft size compared to a speaking voice for example.<br>
<br>
This pitch shifter is based on the pitch shifter code at http://www.dspdimension.com, written by Stephan M. Bernsee.<br>
The original code is COPYRIGHT 1999-2003 Stephan M. Bernsee <smb@dspdimension.com>.<br>
<br>
'<i>maxchannels</i>' dictates the amount of memory allocated. By default, the maxchannels value is 0. If FMOD is set to stereo, the pitch shift unit will allocate enough memory for 2 channels. If it is 5.1, it will allocate enough memory for a 6 channel pitch shift, etc.<br>
If the pitch shift effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.<br>
When the pitch shift is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly. It is only in this case where you might want to increase the channel count above the output's channel count.<br>
If a channel pitch shift is set to a lower number than the sound's channel count that is coming in, it will not pitch shift the sound.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_PITCHSHIFT
{
PITCH, /* Pitch value. 0.5 to 2.0. Default = 1.0. 0.5 = one octave down, 2.0 = one octave up. 1.0 does not change the pitch. */
FFTSIZE, /* FFT window size. 256, 512, 1024, 2048, 4096. Default = 1024. Increase this to reduce 'smearing'. This effect is a warbling sound similar to when an mp3 is encoded at very low bitrates. */
OVERLAP, /* Window overlap. 1 to 32. Default = 4. Increase this to reduce 'tremolo' effect. Increasing it by a factor of 2 doubles the CPU usage. */
MAXCHANNELS /* Maximum channels supported. 0 to 16. 0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc. See remarks for more. Default = 0. It is suggested to leave at 0! */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_CHORUS filter.
[REMARKS]
Chrous is an effect where the sound is more 'spacious' due to 1 to 3 versions of the sound being played along side the original signal but with the pitch of each copy modulating on a sine wave.<br>
This is a highly configurable chorus unit. It supports 3 taps, small and large delay times and also feedback.<br>
This unit also could be used to do a simple echo, or a flange effect.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_CHORUS
{
DRYMIX, /* Volume of original signal to pass to output. 0.0 to 1.0. Default = 0.5. */
WETMIX1, /* Volume of 1st chorus tap. 0.0 to 1.0. Default = 0.5. */
WETMIX2, /* Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap. 0.0 to 1.0. Default = 0.5. */
WETMIX3, /* Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap. 0.0 to 1.0. Default = 0.5. */
DELAY, /* Chorus delay in ms. 0.1 to 100.0. Default = 40.0 ms. */
RATE, /* Chorus modulation rate in hz. 0.0 to 20.0. Default = 0.8 hz. */
DEPTH, /* Chorus modulation depth. 0.0 to 1.0. Default = 0.03. */
FEEDBACK /* Chorus feedback. Controls how much of the wet signal gets fed back into the chorus buffer. 0.0 to 1.0. Default = 0.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_ITECHO filter.<br>
This is effectively a software based echo filter that emulates the DirectX DMO echo effect. Impulse tracker files can support this, and FMOD will produce the effect on ANY platform, not just those that support DirectX effects!<br>
[REMARKS]
Note. Every time the delay is changed, the plugin re-allocates the echo buffer. This means the echo will dissapear at that time while it refills its new buffer.<br>
Larger echo delays result in larger amounts of memory allocated.<br>
<br>
For stereo signals only! This will not work on mono or multichannel signals. This is fine for .IT format purposes, and also if you use System::addDSP with a standard stereo output.<br>
[PLATFORMS]
Win32, Win64, Linux, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
System::addDSP
]
*/
public enum DSP_ITECHO
{
WETDRYMIX, /* Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0.0 through 100.0 (all wet). The default value is 50. */
FEEDBACK, /* Percentage of output fed back into input, in the range from 0.0 through 100.0. The default value is 50. */
LEFTDELAY, /* Delay for left channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */
RIGHTDELAY, /* Delay for right channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */
PANDELAY /* Value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. Possible values are defined as 0.0 (equivalent to FALSE) and 1.0 (equivalent to TRUE). */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_COMPRESSOR unit.<br>
This is a simple linked multichannel software limiter that is uniform across the whole spectrum.<br>
[REMARKS]
The parameters are as follows:
Threshold: [-60dB to 0dB, default 0dB]
Attack Time: [10ms to 200ms, default 50ms]
Release Time: [20ms to 1000ms, default 50ms]
Gain Make Up: [0dB to +30dB, default 0dB]
<br>
The limiter is not guaranteed to catch every peak above the threshold level,
because it cannot apply gain reduction instantaneously - the time delay is
determined by the attack time. However setting the attack time too short will
distort the sound, so it is a compromise. High level peaks can be avoided by
using a short attack time - but not too short, and setting the threshold a few
decibels below the critical level.
<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3
[SEE_ALSO]
DSP::SetParameter
DSP::GetParameter
FMOD_DSP_TYPE
System::addDSP
]
*/
public enum DSP_COMPRESSOR
{
THRESHOLD, /* Threshold level (dB)in the range from -60 through 0. The default value is 50. */
ATTACK, /* Gain reduction attack time (milliseconds), in the range from 10 through 200. The default value is 50. */
RELEASE, /* Gain reduction release time (milliseconds), in the range from 20 through 1000. The default value is 50. */
GAINMAKEUP /* Make-up gain applied after limiting, in the range from 0.0 through 100.0. The default value is 50. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_SFXREVERB unit.<br>
[REMARKS]
This is a high quality I3DL2 based reverb which improves greatly on FMOD_DSP_REVERB.<br>
On top of the I3DL2 property set, "Dry Level" is also included to allow the dry mix to be changed.<br>
<br>
Currently FMOD_DSP_SFXREVERB_REFLECTIONSLEVEL, FMOD_DSP_SFXREVERB_REFLECTIONSDELAY and FMOD_DSP_SFXREVERB_REVERBDELAY are not enabled but will come in future versions.<br>
<br>
These properties can be set with presets in FMOD_REVERB_PRESETS.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3
[SEE_ALSO]
DSP::SetParameter
DSP::GetParameter
FMOD_DSP_TYPE
System::addDSP
FMOD_REVERB_PRESETS
]
*/
public enum DSP_SFXREVERB
{
DRYLEVEL, /* Dry Level : Mix level of dry signal in output in mB. Ranges from -10000.0 to 0.0. Default is 0.0. */
ROOM, /* Room : Room effect level at low frequencies in mB. Ranges from -10000.0 to 0.0. Default is 0.0. */
ROOMHF, /* Room HF : Room effect high-frequency level re. low frequency level in mB. Ranges from -10000.0 to 0.0. Default is 0.0. */
ROOMROLLOFFFACTOR, /* Room Rolloff : Like DS3D flRolloffFactor but for room effect. Ranges from 0.0 to 10.0. Default is 10.0 */
DECAYTIME, /* Decay Time : Reverberation decay time at low-frequencies in seconds. Ranges from 0.1 to 20.0. Default is 1.0. */
DECAYHFRATIO, /* Decay HF Ratio : High-frequency to low-frequency decay time ratio. Ranges from 0.1 to 2.0. Default is 0.5. */
REFLECTIONSLEVEL, /* Reflections : Early reflections level relative to room effect in mB. Ranges from -10000.0 to 1000.0. Default is -10000.0. */
REFLECTIONSDELAY, /* Reflect Delay : Delay time of first reflection in seconds. Ranges from 0.0 to 0.3. Default is 0.02. */
REVERBLEVEL, /* Reverb : Late reverberation level relative to room effect in mB. Ranges from -10000.0 to 2000.0. Default is 0.0. */
REVERBDELAY, /* Reverb Delay : Late reverberation delay time relative to first reflection in seconds. Ranges from 0.0 to 0.1. Default is 0.04. */
DIFFUSION, /* Diffusion : Reverberation diffusion (echo density) in percent. Ranges from 0.0 to 100.0. Default is 100.0. */
DENSITY, /* Density : Reverberation density (modal density) in percent. Ranges from 0.0 to 100.0. Default is 100.0. */
HFREFERENCE, /* HF Reference : Reference high frequency in Hz. Ranges from 20.0 to 20000.0. Default is 5000.0. */
ROOMLF, /* Room LF : Room effect low-frequency level in mB. Ranges from -10000.0 to 0.0. Default is 0.0. */
LFREFERENCE /* LF Reference : Reference low-frequency in Hz. Ranges from 20.0 to 1000.0. Default is 250.0. */
}
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_LOWPASS_SIMPLE filter.<br>
This is a very simple low pass filter, based on two single-pole RC time-constant modules.
The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.<br>
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
public enum DSP_LOWPASS_SIMPLE
{
CUTOFF /* Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0 */
}
/*$ preserve start $*/
}
/*$ preserve end $*/

View File

@ -0,0 +1,120 @@
/* ============================================================================================= = */
/* FMOD Ex - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2014. */
/* */
/* Use this header if you want to store or display a string version / english explanation of */
/* the FMOD error codes. */
/* */
/* =============================================================================================== */
namespace FMOD
{
public class Error
{
public static string String(FMOD.RESULT errcode)
{
switch (errcode)
{
case FMOD.RESULT.OK: return "No errors.";
case FMOD.RESULT.ERR_ALREADYLOCKED: return "Tried to call lock a second time before unlock was called. ";
case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). ";
case FMOD.RESULT.ERR_CDDA_DRIVERS: return "Neither NTSCSI nor ASPI could be initialised. ";
case FMOD.RESULT.ERR_CDDA_INIT: return "An error occurred while initialising the CDDA subsystem. ";
case FMOD.RESULT.ERR_CDDA_INVALID_DEVICE: return "Couldn't find the specified device. ";
case FMOD.RESULT.ERR_CDDA_NOAUDIO: return "No audio tracks on the specified disc. ";
case FMOD.RESULT.ERR_CDDA_NODEVICES: return "No CD/DVD devices were found. ";
case FMOD.RESULT.ERR_CDDA_NODISC: return "No disc present in the specified drive. ";
case FMOD.RESULT.ERR_CDDA_READ: return "A CDDA read error occurred. ";
case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel. ";
case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound. ";
case FMOD.RESULT.ERR_COM: return "A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. ";
case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information. ";
case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependancy. ";
case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format. ";
case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified. ";
case FMOD.RESULT.ERR_DSP_RUNNING: return "DSP error. Cannot perform this operation while the network is in the middle of running. This will most likely happen if a connection or disconnection is attempted in a DSP callback. ";
case FMOD.RESULT.ERR_DSP_TOOMANYCONNECTIONS: return "DSP connection error. The unit being connected to or disconnected should only have 1 input or output. ";
case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file. ";
case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format. ";
case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading. ";
case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated data?). ";
case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found. ";
case FMOD.RESULT.ERR_FILE_UNWANTED: return "Unwanted file access occured. ";
case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format. ";
case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. ";
case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden. ";
case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource. ";
case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred. ";
case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out. ";
case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function. ";
case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init. ";
case FMOD.RESULT.ERR_INTERNAL: return "An error occured that wasn't supposed to. Contact support. ";
case FMOD.RESULT.ERR_INVALID_ADDRESS: return "On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) ";
case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float. ";
case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used. ";
case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function. ";
case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function. ";
case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode. ";
case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular. ";
case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup. ";
case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources. ";
case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. ";
case FMOD.RESULT.ERR_MEMORY_SRAM: return "Not enough memory or resources on console sound ram. ";
case FMOD.RESULT.ERR_NEEDS2D: return "Tried to call a command on a 3d sound when the command was meant for 2d sound. ";
case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound. ";
case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support. (ie trying to play a VAG compressed sound in software on PS2). ";
case FMOD.RESULT.ERR_NEEDSSOFTWARE: return "Tried to use a feature that requires the software engine. Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. ";
case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host. ";
case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere. ";
case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved. ";
case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately. ";
case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound is not ready. ";
case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused. ";
case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer. ";
case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. ";
case FMOD.RESULT.ERR_OUTPUT_ENUMERATION: return "Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal.";
case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). ";
case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device. ";
case FMOD.RESULT.ERR_OUTPUT_NOHARDWARE: return "FMOD_HARDWARE was specified but the sound card does not have the resources nescessary to play it. ";
case FMOD.RESULT.ERR_OUTPUT_NOSOFTWARE: return "Attempted to create a software sound but no software channels were specified in System::init. ";
case FMOD.RESULT.ERR_PAN: return "Panning only works with mono or stereo sound sources. ";
case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a 3rd party plugin. ";
case FMOD.RESULT.ERR_PLUGIN_INSTANCES: return "The number of allowed instances of a plugin has been exceeded ";
case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available. ";
case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) ";
case FMOD.RESULT.ERR_PRELOADED: return "The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. ";
case FMOD.RESULT.ERR_PROGRAMMERSOUND: return "The specified sound is still in use by the event system, wait for the event which is using it finish with it. ";
case FMOD.RESULT.ERR_RECORD: return "An error occured trying to initialize the recording device. ";
case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified Instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because another application has locked the EAX4 FX slot. ";
case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first. ";
case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
case FMOD.RESULT.ERR_SUBSOUND_MODE: return "The subsound's mode bits do not match with the parent sound's mode bits. See documentation for function that it was called with.";
case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occured because the sound referenced contains subsounds. (ie you cannot play the parent sound as a static sample, only its subsounds.) ";
case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags. ";
case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. ";
case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support! ";
case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called. ";
case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified. ";
case FMOD.RESULT.ERR_UPDATE: return "An error caused by System::update occured. ";
case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported. ";
case FMOD.RESULT.ERR_EVENT_FAILED: return "An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. ";
case FMOD.RESULT.ERR_EVENT_GUIDCONFLICT: return "An event with the same GUID already exists. ";
case FMOD.RESULT.ERR_EVENT_INFOONLY: return "Can't execute this command on an EVENT_INFOONLY event. ";
case FMOD.RESULT.ERR_EVENT_INTERNAL: return "An error occured that wasn't supposed to. See debug log for reason. ";
case FMOD.RESULT.ERR_EVENT_MAXSTREAMS: return "Event failed because 'Max streams' was hit when FMOD_INIT_FAIL_ON_MAXSTREAMS was specified. ";
case FMOD.RESULT.ERR_EVENT_MISMATCH: return "FSB mis-matches the FEV it was compiled with. ";
case FMOD.RESULT.ERR_EVENT_NAMECONFLICT: return "A category with the same name already exists. ";
case FMOD.RESULT.ERR_EVENT_NEEDSSIMPLE: return "Tried to call a function on a complex event that's only supported by simple events. ";
case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, event group, event category or event property could not be found. ";
case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified project has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. ";
case FMOD.RESULT.ERR_MUSIC_NOCALLBACK: return "The music callback is required, but it has not been set. ";
case FMOD.RESULT.ERR_MUSIC_UNINITIALIZED: return "Music system is not initialized probably because no music data is loaded. ";
case FMOD.RESULT.ERR_MUSIC_NOTFOUND: return "The requested music entity could not be found.";
default : return "Unknown error.";
}
}
}
}

View File

@ -0,0 +1,199 @@
/* ============================================================================================= */
/* FMOD Ex - Memory info header file. Copyright (c), Firelight Technologies Pty, Ltd. 2009-2014. */
/* */
/* Use this header if you are interested in getting detailed information on FMOD's memory */
/* usage. See the documentation for more details. */
/* */
/* ============================================================================================= */
using System.Runtime.InteropServices;
namespace FMOD
{
/*
[STRUCTURE]
[
[DESCRIPTION]
Structure to be filled with detailed memory usage information of an FMOD object
[REMARKS]
Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
On return from getMemoryInfo, each member of this structure will hold the amount of memory used for its type in bytes.<br>
<br>
Members marked with [in] mean the user sets the value before passing it to the function.<br>
Members marked with [out] mean FMOD sets the value to be used after the function exits.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3
[SEE_ALSO]
System::getMemoryInfo
EventSystem::getMemoryInfo
FMOD_MEMBITS
FMOD_EVENT_MEMBITS
]
*/
[StructLayout(LayoutKind.Sequential)]
public struct MEMORY_USAGE_DETAILS
{
public uint other; /* [out] Memory not accounted for by other types */
public uint stringdata; /* [out] String data */
public uint system; /* [out] System object and various internals */
public uint plugins; /* [out] Plugin objects and internals */
public uint output; /* [out] Output module object and internals */
public uint channel; /* [out] Channel related memory */
public uint channelgroup; /* [out] ChannelGroup objects and internals */
public uint codec; /* [out] Codecs allocated for streaming */
public uint file; /* [out] File buffers and structures */
public uint sound; /* [out] Sound objects and internals */
public uint secondaryram; /* [out] Sound data stored in secondary RAM */
public uint soundgroup; /* [out] SoundGroup objects and internals */
public uint streambuffer; /* [out] Stream buffer memory */
public uint dspconnection; /* [out] DSPConnection objects and internals */
public uint dsp; /* [out] DSP implementation objects */
public uint dspcodec; /* [out] Realtime file format decoding DSP objects */
public uint profile; /* [out] Profiler memory footprint. */
public uint recordbuffer; /* [out] Buffer used to store recorded data from microphone */
public uint reverb; /* [out] Reverb implementation objects */
public uint reverbchannelprops; /* [out] Reverb channel properties structs */
public uint geometry; /* [out] Geometry objects and internals */
public uint syncpoint; /* [out] Sync point memory. */
public uint eventsystem; /* [out] EventSystem and various internals */
public uint musicsystem; /* [out] MusicSystem and various internals */
public uint fev; /* [out] Definition of objects contained in all loaded projects e.g. events, groups, categories */
public uint memoryfsb; /* [out] Data loaded with registerMemoryFSB */
public uint eventproject; /* [out] EventProject objects and internals */
public uint eventgroupi; /* [out] EventGroup objects and internals */
public uint soundbankclass; /* [out] Objects used to manage wave banks */
public uint soundbanklist; /* [out] Data used to manage lists of wave bank usage */
public uint streaminstance; /* [out] Stream objects and internals */
public uint sounddefclass; /* [out] Sound definition objects */
public uint sounddefdefclass; /* [out] Sound definition static data objects */
public uint sounddefpool; /* [out] Sound definition pool data */
public uint reverbdef; /* [out] Reverb definition objects */
public uint eventreverb; /* [out] Reverb objects */
public uint userproperty; /* [out] User property objects */
public uint eventinstance; /* [out] Event instance base objects */
public uint eventinstance_complex; /* [out] Complex event instance objects */
public uint eventinstance_simple; /* [out] Simple event instance objects */
public uint eventinstance_layer; /* [out] Event layer instance objects */
public uint eventinstance_sound; /* [out] Event sound instance objects */
public uint eventenvelope; /* [out] Event envelope objects */
public uint eventenvelopedef; /* [out] Event envelope definition objects */
public uint eventparameter; /* [out] Event parameter objects */
public uint eventcategory; /* [out] Event category objects */
public uint eventenvelopepoint; /* [out] Event envelope point objects */
public uint eventinstancepool; /* [out] Event instance pool memory */
}
/*
[DEFINE]
[
[NAME]
FMOD_MEMBITS
[DESCRIPTION]
Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Ex class.<br>
Use with the "memorybits" parameter of getMemoryInfo to get information on FMOD Ex memory usage.
[REMARKS]
Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
The FMOD_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See System::getMemoryInfo for an example.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii, Solaris
[SEE_ALSO]
FMOD_EVENT_MEMBITS
EventSystem::getMemoryInfo
]
*/
public enum MEMBITS :uint
{
OTHER = 0x00000001, /* Memory not accounted for by other types */
STRING = 0x00000002, /* String data */
SYSTEM = 0x00000004, /* System object and various internals */
PLUGINS = 0x00000008, /* Plugin objects and internals */
OUTPUT = 0x00000010, /* Output module object and internals */
CHANNEL = 0x00000020, /* Channel related memory */
CHANNELGROUP = 0x00000040, /* ChannelGroup objects and internals */
CODEC = 0x00000080, /* Codecs allocated for streaming */
FILE = 0x00000100, /* Codecs allocated for streaming */
SOUND = 0x00000200, /* Sound objects and internals */
SOUND_SECONDARYRAM = 0x00000400, /* Sound data stored in secondary RAM */
SOUNDGROUP = 0x00000800, /* SoundGroup objects and internals */
STREAMBUFFER = 0x00001000, /* Stream buffer memory */
DSPCONNECTION = 0x00002000, /* DSPConnection objects and internals */
DSP = 0x00004000, /* DSP implementation objects */
DSPCODEC = 0x00008000, /* Realtime file format decoding DSP objects */
PROFILE = 0x00010000, /* Profiler memory footprint. */
RECORDBUFFER = 0x00020000, /* Buffer used to store recorded data from microphone */
REVERB = 0x00040000, /* Reverb implementation objects */
REVERBCHANNELPROPS = 0x00080000, /* Reverb channel properties structs */
GEOMETRY = 0x00100000, /* Geometry objects and internals */
SYNCPOINT = 0x00200000, /* Sync point memory. */
ALL = 0xffffffff /* All memory used by FMOD Ex */
}
/*
[DEFINE]
[
[NAME]
FMOD_EVENT_MEMBITS
[DESCRIPTION]
Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Event System class.<br>
Use with the "event_memorybits" parameter of getMemoryInfo to get information on FMOD Event System memory usage.
[REMARKS]
Every public FMOD Event System class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
The FMOD_EVENT_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See EventSystem::getMemoryInfo for an example.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox, Xbox360, PlayStation 2, GameCube, PlayStation Portable, PlayStation 3, Wii, Solaris
[SEE_ALSO]
FMOD_MEMBITS
System::getMemoryInfo
]
*/
public enum EVENT_MEMBITS :uint
{
EVENTSYSTEM = 0x00000001, /* EventSystem and various internals */
MUSICSYSTEM = 0x00000002, /* MusicSystem and various internals */
FEV = 0x00000004, /* Definition of objects contained in all loaded projects e.g. events, groups, categories */
MEMORYFSB = 0x00000008, /* Data loaded with registerMemoryFSB */
EVENTPROJECT = 0x00000010, /* EventProject objects and internals */
EVENTGROUPI = 0x00000020, /* EventGroup objects and internals */
SOUNDBANKCLASS = 0x00000040, /* Objects used to manage wave banks */
SOUNDBANKLIST = 0x00000080, /* Data used to manage lists of wave bank usage */
STREAMINSTANCE = 0x00000100, /* Stream objects and internals */
SOUNDDEFCLASS = 0x00000200, /* Sound definition objects */
SOUNDDEFDEFCLASS = 0x00000400, /* Sound definition static data objects */
SOUNDDEFPOOL = 0x00000800, /* Sound definition pool data */
REVERBDEF = 0x00001000, /* Reverb definition objects */
EVENTREVERB = 0x00002000, /* Reverb objects */
USERPROPERTY = 0x00004000, /* User property objects */
EVENTINSTANCE = 0x00008000, /* Event instance base objects */
EVENTINSTANCE_COMPLEX = 0x00010000, /* Complex event instance objects */
EVENTINSTANCE_SIMPLE = 0x00020000, /* Simple event instance objects */
EVENTINSTANCE_LAYER = 0x00040000, /* Event layer instance objects */
EVENTINSTANCE_SOUND = 0x00080000, /* Event sound instance objects */
EVENTENVELOPE = 0x00100000, /* Event envelope objects */
EVENTENVELOPEDEF = 0x00200000, /* Event envelope definition objects */
EVENTPARAMETER = 0x00400000, /* Event parameter objects */
EVENTCATEGORY = 0x00800000, /* Event category objects */
EVENTENVELOPEPOINT = 0x01000000, /* Event envelope point objects */
EVENTINSTANCEPOOL = 0x02000000, /* Event instance pool data */
ALL = 0xffffffff, /* All memory used by FMOD Event System */
/* All event instance memory */
EVENTINSTANCE_GROUP = (EVENTINSTANCE | EVENTINSTANCE_COMPLEX | EVENTINSTANCE_SIMPLE | EVENTINSTANCE_LAYER | EVENTINSTANCE_SOUND),
/* All sound definition memory */
SOUNDDEF_GROUP = (SOUNDDEFCLASS | SOUNDDEFDEFCLASS | SOUNDDEFPOOL)
}
}