本文整理汇总了C++中Listener::compile方法的典型用法代码示例。如果您正苦于以下问题:C++ Listener::compile方法的具体用法?C++ Listener::compile怎么用?C++ Listener::compile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Listener
的用法示例。
在下文中一共展示了Listener::compile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MyApp
MyApp() : scene(BLOCK_SIZE) {
speakerLayout = new SpeakerLayout();
if (onLaptop) {
cout << "Using 2 speaker layout" << endl;
speakerLayout->addSpeaker(Speaker(0, 45, 0, 1.0, 1.0));
speakerLayout->addSpeaker(Speaker(1, -45, 0, 1.0, 1.0));
}
else {
cout << "Using 3 speaker layout" << endl;
speakerLayout->addSpeaker(Speaker(0, 0, 0, 100.0, 1.0));
speakerLayout->addSpeaker(Speaker(1, 120, 0, 100.0, 1.0));
speakerLayout->addSpeaker(Speaker(2,-120, 0, 100.0, 1.0));
//speakerLayout->addSpeaker(Speaker(3, 0, 0, 0.0, 0.5));
}
panner = new Vbap(*speakerLayout);
panner->setIs3D(false); // no 3d!
listener = scene.createListener(panner);
listener->compile();
for (int i = 0; i < 10; i++) {
source[i].dopplerType(DOPPLER_NONE); // XXX doppler kills when moving fast!
source[i].law(ATTEN_LINEAR);
scene.addSource(source[i]);
}
panner->print();
scene.usePerSampleProcessing(false);
AudioDevice::printAll();
audioIO().print();
fflush(stdout);
if (onLaptop) {
cout << "we're on a laptop, so use normal, default audio hardware" << endl;
initAudio(44100, BLOCK_SIZE);
}
else {
cout << "we're on the mini, so we will try the TASCAM" << endl;
// audioIO().device(AudioDevice("TASCAM"));
audioIO().device(AudioDevice(29));
initAudio(44100, BLOCK_SIZE, 4, 0);
}
cout << "GOT HERE" << endl;
audioIO().print();
fflush(stdout);
}
示例2: audioScene
MyApp () :
audioScene(BLOCK_SIZE),
spatializer(speakerLayout)
{
initWindow();
addSphere(graphics().mesh());
graphics().mesh().generateNormals();
for (int i = 0; i < 50; ++i) {
source[i].freq(150 + random.uniform(-1, 1));
audioScene.addSource(source[i]);
}
for (int i = 0; i < 50; ++i) {
source[i + 50].freq(700 + random.uniform(-2, 2));
audioScene.addSource(source[i + 50]);
}
for (int i = 0; i < 50; ++i) {
source[i + 50].freq(1800 + random.uniform(-3, 3));
audioScene.addSource(source[i + 100]);
}
gam::sampleRate(44100);
audioIO().device(0);
initAudio(44100, BLOCK_SIZE);
listener = audioScene.createListener(&spatializer);
listener->compile();
for (int i = 0; i < 150; ++i) {
double ft1 = data[i * 4];
double ft2 = data[(i * 4)+ 1];
double ft3 = data[(i * 4)+ 2];
double ft4 = data[(i * 4)+ 3];
double x = mapRange(ft1, 4.3, 7.9, -10.0, 10.0);
double y = mapRange(ft2, 2.0, 4.4, -10.0, 10.0);
double z = mapRange(ft3, 1.0, 6.9, -10.0, 10.0);
// double size = mapRange(ft4, 0.1, 2.5, 0.25, 0.5);
source[i].pos(x, y, z);
source[i].farClip(2);
}
audioScene.usePerSampleProcessing(false);
}
示例3: Listener
Listener * AudioScene::createListener(Spatializer* spatializer){
Listener * l = new Listener(mNumFrames, spatializer);
l->compile();
mListeners.push_back(l);
return l;
}