Documentation for module: Audio

Former-commit-id: 0b55ca6dd75769c29d8882a709395a8b90203759
This commit is contained in:
Gawaboumga
2016-05-30 13:36:52 +02:00
parent d4bc32717f
commit 9eae42f72b
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);
}
}