本文整理汇总了C#中FMOD.Channel.setChannelGroup方法的典型用法代码示例。如果您正苦于以下问题:C# Channel.setChannelGroup方法的具体用法?C# Channel.setChannelGroup怎么用?C# Channel.setChannelGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FMOD.Channel
的用法示例。
在下文中一共展示了Channel.setChannelGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadSongToDelay
//This function is used to add a delay in the detection to playback ratio.
//For example, if an obstacle is spawned to the music, it will be spawned immediately
//upon the song detecting a beat, when oftentimes we want to line up that obstacle
//with the point in the music it plays. So, the obstacle will spawn before the song gets
//to the beat detected point.
//Use milliseconds to express the amount of delay time you want between playback and detection.
public void loadSongToDelay(int milliseconds)
{
delayedSong = true;
songChannel1.setVolume(0);
audio2 = new FMOD.Sound();
FMODErrorCheck(system.createStream(songString, FMOD.MODE.SOFTWARE, ref audio2));
songChannel2 = new FMOD.Channel();
FMODErrorCheck(system.playSound(FMOD.CHANNELINDEX.FREE, audio2, true, ref songChannel2));
songChannel2.setChannelGroup(channelMusic);
timeToDelay = milliseconds;
}
示例2: 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);
}