Documentation for module: Audio

Former-commit-id: acb9e00a7af8bf1c36f42b45fe7e7df99e03c0f9
This commit is contained in:
Gawaboumga
2016-05-30 13:36:52 +02:00
parent ea920d2e64
commit 8336c05522
23 changed files with 1110 additions and 56 deletions

View File

@@ -0,0 +1,19 @@
#include <Nazara/Audio/Algorithm.hpp>
#include <Catch/catch.hpp>
#include <array>
TEST_CASE("MixToMono", "[AUDIO][ALGORITHM]")
{
SECTION("Mix two channels together")
{
std::array<int, 4> input{ 1, 3, 5, 3 };
std::array<int, 2> output{ 0, 0 };
// Two channels and two frames !
Nz::MixToMono(input.data(), output.data(), 2, 2);
std::array<int, 2> theoric{ 2, 4 }; // It's the mean of the two channels
REQUIRE(output == theoric);
}
}