Documentation for module: Audio
Former-commit-id: 4546f9db5579c219d708f87b7062104d24ec6da2
This commit is contained in:
19
tests/Engine/Audio/AlgorithmAudio.cpp
Normal file
19
tests/Engine/Audio/AlgorithmAudio.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user