Shows the basic usage of OALplus by playing a soundCopyright 2008-2014 Matus Chochlik. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <chrono>
#include <thread>
int main(int argc, char** argv)
{
device,
.Get()
);
listener.
Orientation(0.0f, 0.0f,-1.0f, 0.0f, 1.0f, 0.0f);
source.Buffer(buffer);
source.Looping(true);
source.ReferenceDistance(15);
source.Play();
oalplus::CubicBezierLoop<oalplus::Vec3f, double> path({
});
typedef std::chrono::system_clock clock;
typedef std::chrono::time_point<clock> time_point;
time_point start = clock::now();
while(true)
{
double t = double((clock::now() - start).count())*
double(clock::period::num)/
double(clock::period::den);
if(t > 10.0) break;
source.Position(path.Position(t/5.0));
std::chrono::milliseconds duration(10);
std::this_thread::sleep_for(duration);
}
return 0;
}