Updated tutorials to use cVector3 and the new getListener function
This commit is contained in:
parent
f9370efcd9
commit
93e36c4a03
|
@ -9,6 +9,8 @@
|
|||
#include "../../include/IAudioManager.h"
|
||||
//Include IAudio so we can create cAudio objects
|
||||
#include "../../include/IAudio.h"
|
||||
//Include The cAudio vector class
|
||||
#include "../../include/cVector3.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -36,15 +38,15 @@ int main(int argc, char* argv[])
|
|||
//play3d takes 4 arguments play3d(toloop,x,y,z,strength)
|
||||
if(mysound && listener)
|
||||
{
|
||||
listener->setPosition(0,0,0);
|
||||
mysound->play3d(true,0.0,0.0,0.0,0.1);
|
||||
listener->setPosition(cAudio::cVector3(0,0,0));
|
||||
mysound->play3d(cAudio::cVector3(0,0,0),0.1,true);
|
||||
|
||||
while(mysound->playing())
|
||||
{
|
||||
//Playback sound
|
||||
x+=0.001f * 0.017453293f; //0.001 degrees a frame
|
||||
float realX = sinf(x)*10.f;
|
||||
mysound->setPosition(realX,0.0,-5.0);
|
||||
mysound->setPosition(cAudio::cVector3(realX,0.0,-5.0));
|
||||
manager->update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +1,51 @@
|
|||
//****************************************************************
|
||||
//cAudio 1.7.1 Tutorial 3
|
||||
//Basic Memory Playback *Virtual file systems*
|
||||
//bling.h created with bin2h http://deadnode.org/sw/bin2h/
|
||||
//****************************************************************
|
||||
|
||||
//****************************************************************
|
||||
//cAudio 1.7.1 Tutorial 3
|
||||
//Basic Memory Playback *Virtual file systems*
|
||||
//bling.h created with bin2h http://deadnode.org/sw/bin2h/
|
||||
//****************************************************************
|
||||
|
||||
#include <iostream>
|
||||
//Include IAudioManager so we can easily work with cAudio
|
||||
#include "../../include/IAudioManager.h"
|
||||
//Include IAudioManager so we can easily work with cAudio
|
||||
#include "../../include/IAudioManager.h"
|
||||
//Include IAudio so we can create cAudio objects
|
||||
#include "../../include/IAudio.h"
|
||||
//Our Bling sound
|
||||
#include "../../include/IAudio.h"
|
||||
//Include The cAudio vector class
|
||||
#include "../../include/cVector3.h"
|
||||
//Our Bling sound
|
||||
#include "bling.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
//Make visual studio happy
|
||||
cAudio::IAudio* mysound = 0x0;
|
||||
//Some fancy text
|
||||
cout << "cAudio 1.7.1 Tutorial 3: MemoryPlayback \n";
|
||||
//Grap the cAudioManager
|
||||
cAudio::IAudioManager* manager = cAudio::getAudioManager();
|
||||
//Init the cAudio Engine
|
||||
manager->init(argc,argv);
|
||||
manager->setListenerPos(0.0,0.0,0.0);
|
||||
//Create a IAudio object and load a sound from memory. using the bling array and bling size generated by bin2h.
|
||||
//Some fancy text
|
||||
cout << "cAudio 1.7.1 Tutorial 3: MemoryPlayback \n";
|
||||
//Grap the cAudioManager
|
||||
cAudio::IAudioManager* manager = cAudio::getAudioManager();
|
||||
//Init the cAudio Engine
|
||||
manager->init(argc,argv);
|
||||
manager->getListener()->setPosition(cAudio::cVector3(0.0,0.0,0.0));
|
||||
//Create a IAudio object and load a sound from memory. using the bling array and bling size generated by bin2h.
|
||||
|
||||
mysound = manager->createFromMemory("bling",(const char*)bling,bling_size,"wav");
|
||||
|
||||
if(mysound)
|
||||
{
|
||||
//Set the IAudio Sound to play2d and loop
|
||||
mysound->play2d(true);
|
||||
|
||||
while(mysound->playing())
|
||||
{
|
||||
//Playback sound
|
||||
//Set the IAudio Sound to play2d and loop
|
||||
mysound->play2d(true);
|
||||
|
||||
while(mysound->playing())
|
||||
{
|
||||
//Playback sound
|
||||
manager->update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Delete all IAudio sounds
|
||||
manager->release();
|
||||
manager->release();
|
||||
//Shutdown cAudio
|
||||
manager->shutDown();
|
||||
return 0;
|
||||
|
|
|
@ -65,8 +65,8 @@ namespace cAudio
|
|||
LOAD_AL_FUNC(alGenEffects);
|
||||
LOAD_AL_FUNC(alDeleteEffects);
|
||||
LOAD_AL_FUNC(alIsEffect);
|
||||
|
||||
*/
|
||||
|
||||
initCapture.checkCaptureExtension();
|
||||
initCapture.initialize();
|
||||
|
||||
|
|
Loading…
Reference in New Issue