本文整理汇总了C#中FMOD.Channel.setPaused方法的典型用法代码示例。如果您正苦于以下问题:C# Channel.setPaused方法的具体用法?C# Channel.setPaused怎么用?C# Channel.setPaused使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FMOD.Channel
的用法示例。
在下文中一共展示了Channel.setPaused方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}