本文整理汇总了C#中FMOD.ChannelGroup类的典型用法代码示例。如果您正苦于以下问题:C# ChannelGroup类的具体用法?C# ChannelGroup怎么用?C# ChannelGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChannelGroup类属于FMOD命名空间,在下文中一共展示了ChannelGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createChannelGroup
public RESULT createChannelGroup(string name, out ChannelGroup channelgroup)
{
channelgroup = null;
byte[] bytes = Encoding.UTF8.GetBytes(name + '\0');
IntPtr raw;
RESULT result = System.FMOD5_System_CreateChannelGroup(this.rawPtr, bytes, out raw);
channelgroup = new ChannelGroup(raw);
return result;
}
示例2: getMasterChannelGroup
public RESULT getMasterChannelGroup (out ChannelGroup channelgroup)
{
channelgroup = null;
IntPtr channelgroupraw;
RESULT result = FMOD_System_GetMasterChannelGroup(rawPtr, out channelgroupraw);
channelgroup = new ChannelGroup(channelgroupraw);
return result;
}
示例3: Channel
public RESULT playDSP (DSP dsp, ChannelGroup channelGroup, bool paused, out Channel channel)
{
channel = null;
IntPtr channelGroupRaw = (channelGroup != null) ? channelGroup.getRaw() : IntPtr.Zero;
IntPtr channelraw;
RESULT result = FMOD_System_PlayDSP(rawPtr, dsp.getRaw(), channelGroupRaw, paused, out channelraw);
channel = new Channel(channelraw);
return result;
}
示例4: FMOD_System_CreateChannelGroup
public RESULT createChannelGroup (string name, out ChannelGroup channelgroup)
{
channelgroup = null;
byte[] stringData = Encoding.UTF8.GetBytes(name + Char.MinValue);
IntPtr channelgroupraw;
RESULT result = FMOD_System_CreateChannelGroup(rawPtr, stringData, out channelgroupraw);
channelgroup = new ChannelGroup(channelgroupraw);
return result;
}
示例5: IntPtr
public RESULT playSound (Sound sound, ChannelGroup channelGroup, bool paused, ref Channel channel)
{
RESULT result = RESULT.OK;
IntPtr channelraw;
Channel channelnew = null;
if (channel != null)
{
channelraw = channel.getRaw();
}
else
{
channelraw = new IntPtr();
}
IntPtr channelGroupRaw = (channelGroup != null) ? channelGroup.getRaw() : (IntPtr)0;
try
{
result = FMOD_System_PlaySound(systemraw, sound.getRaw(), channelGroupRaw, (paused ? 1 : 0), ref channelraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (channel == null)
{
channelnew = new Channel();
channelnew.setRaw(channelraw);
channel = channelnew;
}
else
{
channel.setRaw(channelraw);
}
return result;
}
示例6: getParentGroup
public RESULT getParentGroup(ref ChannelGroup group)
{
RESULT result = RESULT.OK;
IntPtr channelraw = new IntPtr();
ChannelGroup channelnew = null;
try
{
result = FMOD_ChannelGroup_GetParentGroup(channelgroupraw, ref channelraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (group == null)
{
channelnew = new ChannelGroup();
channelnew.setRaw(channelraw);
group = channelnew;
}
else
{
group.setRaw(channelraw);
}
return result;
}
示例7: setChannelGroup
public RESULT setChannelGroup(ChannelGroup channelgroup)
{
return FMOD_Channel_SetChannelGroup(channelraw, channelgroup.getRaw());
}
示例8: FMOD_Channel_GetChannelGroup
public RESULT getChannelGroup (out ChannelGroup channelgroup)
{
channelgroup = null;
IntPtr channelgroupraw;
RESULT result = FMOD_Channel_GetChannelGroup(getRaw(), out channelgroupraw);
channelgroup = new ChannelGroup(channelgroupraw);
return result;
}
示例9: LoadSong
//Loads a song into memory given a sample size and file-path to an audio file.
//The most commonly used and accurate Sample Size is 1024.
public void LoadSong(int sSize, string audioString)
{
//Take in Aruguments
sampleSize = sSize;
songString = audioString;
stopW.Start();
areWePlaying = true;
specFlux = 0.0f;
timeBetween = 0;
initialTime = (int)stopW.ElapsedMilliseconds;
currentTime = 0;
currentSeconds = 0;
lastSeconds = 0;
currentMillis = 0;
currentMinutes = 0;
median = 0.0f;
smoothMedian = 0.0f;
beatThreshold = 0.6f;
thresholdSmoother = 0.6f;
started = false;
lastBeatRegistered = new TimeStamp();
audio = new FMOD.Sound();
songChannel1 = new FMOD.Channel();
channelMusic = new FMOD.ChannelGroup();
previousFFT = new float[sampleSize
/ 2 + 1];
for (int i = 0; i < sampleSize / 2; i++)
{
previousFFT[i] = 0;
}
//Brute force for testing
//songString = "Music/drums.wav";
//Create channel and audio
FMODErrorCheck(system.createChannelGroup(null, ref channelMusic));
// CREATESOUNDEXINFO ex = new CREATESOUNDEXINFO();
FMODErrorCheck(system.createStream(songString, FMOD.MODE.SOFTWARE, ref audio));
audio.getLength(ref seconds, FMOD.TIMEUNIT.MS);
audio.getDefaults(ref sampleRate, ref zeroF, ref zeroF, ref zero);
seconds = ((seconds + 500) / 1000);
minutes = seconds / 60;
fullSeconds = (int)seconds;
seconds = seconds - (minutes * 60);
FMODErrorCheck(system.playSound(FMOD.CHANNELINDEX.FREE, audio, true, ref songChannel1));
//hzRange = (sampleRate / 2) / static_cast<float>(sampleSize);
songChannel1.setChannelGroup(channelMusic);
songChannel1.setPaused(true);
Console.WriteLine("Song Length: " + minutes + ":" + seconds);
Console.WriteLine("Sample Rate: " + sampleRate);
//std::cout << "Freq Range: " << hzRange << std::endl;
//songChannel1.setVolume(0);
}
示例10: getChannelGroup
public RESULT getChannelGroup(ref ChannelGroup channelgroup)
{
RESULT result = RESULT.OK;
IntPtr cgraw = new IntPtr();
ChannelGroup cgnew = null;
try
{
result = FMOD_Event_GetChannelGroup(eventraw, ref cgraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (channelgroup == null)
{
cgnew = new ChannelGroup();
cgnew.setRaw(cgraw);
channelgroup = cgnew;
}
else
{
channelgroup.setRaw(cgraw);
}
return result;
}
示例11: createChannelGroup
public RESULT createChannelGroup(string name, ref ChannelGroup channelgroup)
{
var result = RESULT.OK;
var channelgroupraw = new IntPtr();
ChannelGroup channelgroupnew = null;
try
{
result = FMOD_System_CreateChannelGroup(systemraw, name, ref channelgroupraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (channelgroup == null)
{
channelgroupnew = new ChannelGroup();
channelgroupnew.setRaw(channelgroupraw);
channelgroup = channelgroupnew;
}
else
{
channelgroup.setRaw(channelgroupraw);
}
return result;
}
示例12: playSound
public RESULT playSound(Sound sound, ChannelGroup channelGroup, bool paused, out Channel channel)
{
channel = null;
IntPtr channelGroup2 = (!(channelGroup != null)) ? IntPtr.Zero : channelGroup.getRaw();
IntPtr raw;
RESULT result = System.FMOD5_System_PlaySound(this.rawPtr, sound.getRaw(), channelGroup2, paused, out raw);
channel = new Channel(raw);
return result;
}
示例13: getMasterChannelGroup
public RESULT getMasterChannelGroup(out ChannelGroup channelgroup)
{
channelgroup = null;
IntPtr raw;
RESULT result = System.FMOD5_System_GetMasterChannelGroup(this.rawPtr, out raw);
channelgroup = new ChannelGroup(raw);
return result;
}
示例14: detachChannelGroupFromPort
public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup)
{
return System.FMOD5_System_DetachChannelGroupFromPort(this.rawPtr, channelgroup.getRaw());
}
示例15: attachChannelGroupToPort
// Routing to ports.
public RESULT attachChannelGroupToPort(uint portType, ulong portIndex, ChannelGroup channelgroup)
{
return FMOD_System_AttachChannelGroupToPort(rawPtr, portType, portIndex, channelgroup.getRaw());
}