My first attempts to create an ambient sound lead me to midi and to Apples Garage Band. I learn to tweak instruments to create xylophone style sounds and used the keypad keyboard function to compose it.
After several attempts with Adobes, Audition and SoundBooth (which can even mix tracks?) to create the right formats i began to think about what my project brief insinuated: 'open source and free software will solve it' so i remembered Audacity.
Problem solved.
AudaCity
Creating sound in Audacity
After my effects were mixed and converted to the vorbis ogg format it was back back into Code Blocks to 'paste' it into the 3D landscape. My first problems, the irrKlang engine would not immediately recognize where the OGRE camera was so it was back to the code to link it to the cameras position and orientation,
Vector3 cp = mCamera->getPosition();and then it was just a matter of tweaking sound values in space.
cmX = cp.x;
cmY = cp.y;
cmZ = cp.z;
irrklang::vec3df position(cmX,cmY,cmZ); // position of the listener
irrklang::vec3df lookDirection(10,0,10); // the direction the listener looks into
irrklang::vec3df velPerSecond(0,0,0); // only relevant for doppler effects
irrklang::vec3df upVector(0,1,0); // where 'up' is in your 3D scene
engine->setListenerPosition(position, lookDirection, velPerSecond, upVector);
ISound* music2 = engine->play3D("../../media/sounds/fireloop.ogg", vec3df(210, 30, -30), true, false, true);
music2->setVolume(120.0f);
music2->setMinDistance(40.0f);
No comments:
Post a Comment