本文整理汇总了C++中Kiss::setData方法的典型用法代码示例。如果您正苦于以下问题:C++ Kiss::setData方法的具体用法?C++ Kiss::setData怎么用?C++ Kiss::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kiss
的用法示例。
在下文中一共展示了Kiss::setData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//*************************************************************************
void BeatDetectorApp::update()
{
if(write_frames)
{
if(curr_sample < p_sample->m_SampleCount)
{
// Initialize analyzer, if needed
if (!mFftInit)
{
Init(samples_per_frame);
}
mFft.setData(p_sample->mp_Buffer + (curr_sample));
curr_sample += samples_per_frame;
CSoundAnalyzer::Get().ProcessData(mFft.getAmplitude(), mFft.getData());
}
else
{
shutdown();
}
}
else
{
// Check if track is playing and has a PCM buffer available
if (mTrack->isPlaying() && mTrack->isPcmBuffering())
{
// Get buffer
mBuffer = mTrack->getPcmBuffer();
if (mBuffer && mBuffer->getInterleavedData())
{
// Get sample count
uint32_t mSampleCount = mBuffer->getChannelData(CHANNEL_FRONT_LEFT)->mSampleCount;
if (mSampleCount > 0)
{
// Initialize analyzer, if needed
if (!mFftInit)
{
Init(samples_per_frame);
}
// Analyze data
if (mBuffer->getChannelData(CHANNEL_FRONT_LEFT)->mData != 0)
mFft.setData(mBuffer->getChannelData(CHANNEL_FRONT_LEFT)->mData);
CSoundAnalyzer::Get().ProcessData(mFft.getAmplitude(), mFft.getData());
}
}
}
}
}
示例2: update
// Runs update logic
void KissFileSampleApp::update()
{
// Check if track is playing and has a PCM buffer available
if (mTrack->isPlaying() && mTrack->isPcmBuffering())
{
// Get buffer
mBuffer = mTrack->getPcmBuffer();
if (mBuffer && mBuffer->getInterleavedData())
{
// Get sample count
uint32_t mSampleCount = mBuffer->getInterleavedData()->mSampleCount;
if (mSampleCount > 0)
{
// Initialize analyzer, if needed
if (!mFftInit)
{
mFftInit = true;
mFft.setDataSize(mSampleCount);
}
// Analyze data
if (mBuffer->getInterleavedData()->mData != 0)
mFft.setData(mBuffer->getInterleavedData()->mData);
}
}
}
}