本文整理汇总了C#中FMOD类的典型用法代码示例。如果您正苦于以下问题:C# FMOD类的具体用法?C# FMOD怎么用?C# FMOD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMOD类属于命名空间,在下文中一共展示了FMOD类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EqualizerBand
private EqualizerBand(FMOD.System system, DSP dspParamEq, float centerValue, float gainValue, bool active)
{
this.fmodSystem = system;
this.dspEQ = dspParamEq;
if (centerValue >= 1000)
{
this.BandCaption = string.Format("{0}K", (centerValue / 1000));
}
else
{
this.BandCaption = centerValue.ToString(CultureInfo.InvariantCulture);
}
this.WhenAnyValue(x => x.Gain)
.Subscribe(newGain => {
if (this.IsActive && this.dspEQ != null)
{
System.Diagnostics.Debug.WriteLine(">> Gain value: " + newGain);
this.dspEQ.setActive(false).ERRCHECK();
this.dspEQ.setParameterFloat((int)FMOD.DSP_PARAMEQ.GAIN, newGain).ERRCHECK();
this.dspEQ.setActive(true).ERRCHECK();
this.fmodSystem.update().ERRCHECK();
}
});
this.Gain = gainValue;
this.IsActive = active;
}
示例2: READCALLBACK
/// <summary>
/// Readcallback
/// </summary>
/// <param name="dsp_state"></param>
/// <param name="inbuf"></param>
/// <param name="outbuf"></param>
/// <param name="length"></param>
/// <param name="inchannels"></param>
/// <param name="outchannels"></param>
/// <returns></returns>
private static FMOD.RESULT READCALLBACK(ref FMOD.DSP_STATE dsp_state, IntPtr inbuf, IntPtr outbuf, uint length, int inchannels, int outchannels)
{
uint count = 0;
int count2 = 0;
IntPtr thisdspraw = dsp_state.instance;
thisdsp.setRaw(thisdspraw);
unsafe
{
float* inbuffer = (float*)inbuf.ToPointer();
float* outbuffer = (float*)outbuf.ToPointer();
for (count = 0; count < length; count++)
{
for (count2 = 0; count2 < outchannels; count2++)
{
outbuffer[(count * outchannels) + count2] = inbuffer[(count * inchannels) + count2];
}
bpm.AddSample(inbuffer[(count * inchannels)] * 32767.0f);
}
}
return FMOD.RESULT.OK;
}
示例3: SoundGroup
public SoundGroup(FMOD.SoundGroup fmodSoundGroup)
{
if (fmodSoundGroup == null)
throw new ArgumentNullException("fmodSoundGroup");
_fmodGroup = fmodSoundGroup;
}
示例4: System
public System(FMOD.Studio.System system)
{
//Load native dependencies
Native.Load();
_system = system;
}
示例5: Equalizer
private Equalizer(FMOD.System system, SMPSettings settings) {
this.smpSettings = settings;
this.Name = "DefaultEqualizer";
this.fmodSystem = system;
this.Bands = new ObservableCollection<EqualizerBand>();
this.isEnabled = settings.PlayerSettings.EqualizerSettings == null || settings.PlayerSettings.EqualizerSettings.IsEnabled;
}
示例6: Init
private void Init(FMOD.System system, bool setToDefaultValues = false)
{
system.lockDSP().ERRCHECK();
this.Bands.Clear();
var gainValues = !setToDefaultValues && this.playerSettings.PlayerEngine.EqualizerSettings != null
? this.playerSettings.PlayerEngine.EqualizerSettings.GainValues
: null;
foreach (var value in EqDefaultValues)
{
var band = EqualizerBand.GetEqualizerBand(system, this.IsEnabled, value[0], value[1], value[2]);
if (band != null)
{
float savedValue;
if (gainValues != null && gainValues.TryGetValue(band.BandCaption, out savedValue))
{
band.Gain = savedValue;
}
this.Bands.Add(band);
}
}
system.unlockDSP().ERRCHECK();
system.update().ERRCHECK();
}
示例7: ERRCHECK
static void ERRCHECK(FMOD.RESULT result)
{
if (result != FMOD.RESULT.OK)
{
Debug.Log("FMOD_Unity: FmodEventImportPostProcessor: " + result + " - " + FMOD.Error.String(result));
}
}
示例8: FmodMusicParameter
public FmodMusicParameter(FMOD.MUSIC_ENTITY cue, FmodMusicSystem musicSystem)
{
m_id = (int)cue.id;
m_name = cue.name;
m_musicSystem = musicSystem;
}
示例9: Sound
internal Sound(FMOD.Sound sound, string file, string name, float volume = 1.0f)
{
_sound = sound;
_file = file;
_name = name;
_volume = volume;
}
示例10: CheckResult
public static void CheckResult(FMOD.RESULT result)
{
if (result != FMOD.RESULT.OK)
{
UnityEngine.Debug.LogError(string.Format("FMOD Studio: Encounterd Error: {0} {1}", result, FMOD.Error.String(result)));
}
}
示例11: FMOD_EVENT_CALLBACK
private static FMOD.RESULT FMOD_EVENT_CALLBACK(IntPtr eventraw, FMOD.EVENT_CALLBACKTYPE type, IntPtr param1, IntPtr param2, IntPtr userdata)
{
unsafe
{
switch (type)
{
case FMOD.EVENT_CALLBACKTYPE.SOUNDDEF_CREATE :
{
int entryindex = *(int*)param2.ToPointer() ; // [in] (int) index of sound definition entry
uint *realpointer = (uint *)param2.ToPointer(); // [out] (FMOD::Sound *) a valid lower level API FMOD Sound handle
FMOD.Sound s = null;
fsb.getSubSound(entryindex, ref s);
*realpointer = (uint)s.getRaw().ToPointer();
break;
}
case FMOD.EVENT_CALLBACKTYPE.SOUNDDEF_RELEASE :
{
break;
}
}
}
return FMOD.RESULT.OK;
}
示例12: ERRMSG
internal static String ERRMSG(FMOD.RESULT result)
{
if (result != FMOD.RESULT.OK)
{
return FMOD.Error.String(result);
}
return "";
}
示例13: onBeat
public FMOD.RESULT onBeat(FMOD.Studio.EVENT_CALLBACK_TYPE type, IntPtr eventInstance, IntPtr parameters) {
foreach (FMODCallback function in callbacks) {
function.Invoke(type, eventInstance, parameters);
}
queue.RemoveAll(callback => callback.Invoke(type, eventInstance, parameters));
return FMOD.RESULT.OK;
}
示例14: GetFmodPath
public string GetFmodPath(FMOD.Studio.EventInstance fmodEvent)
{
FMOD.Studio.EventDescription ed;
string path;
fmodEvent.getDescription(out ed);
ed.getPath(out path);
return path;
}
示例15: ERRCHECK
//FMOD error checking codes
void ERRCHECK(FMOD.RESULT result)
{
if (result != FMOD.RESULT.OK)
{
Debug.Log("FMOD error! " + result + " - " + FMOD.Error.String(result));
}
}