Audio: Rewrite audio module

This commit is contained in:
Jérôme Leclercq
2022-03-17 09:07:52 +01:00
parent eb4629947e
commit 6165b3a101
43 changed files with 1898 additions and 1611 deletions

View File

@@ -31,7 +31,7 @@ SCENARIO("Music", "[AUDIO][MUSIC]")
THEN("We can play it and get the time offset")
{
Nz::Audio::Instance()->SetGlobalVolume(0.f);
Nz::Audio::Instance()->GetDefaultDevice()->SetGlobalVolume(0.f);
music.Play();
std::this_thread::sleep_for(std::chrono::seconds(1));
@@ -44,7 +44,7 @@ SCENARIO("Music", "[AUDIO][MUSIC]")
music.SetPlayingOffset(3500);
REQUIRE(music.GetPlayingOffset() >= 3500);
Nz::Audio::Instance()->SetGlobalVolume(100.f);
Nz::Audio::Instance()->GetDefaultDevice()->SetGlobalVolume(100.f);
}
}
}

View File

@@ -19,7 +19,7 @@ SCENARIO("SoundEmitter", "[AUDIO][SOUNDEMITTER]")
sound.SetPosition(Nz::Vector3f::Zero());
sound.SetVelocity(Nz::Vector3f::UnitX());
REQUIRE(sound.IsSpatialized());
REQUIRE(sound.IsSpatializationEnabled());
REQUIRE(sound.GetPosition() == Nz::Vector3f::Zero());
REQUIRE(sound.GetVelocity() == Nz::Vector3f::UnitX());
}

View File

@@ -26,7 +26,7 @@ SCENARIO("Sound", "[AUDIO][SOUND]")
THEN("We can play it and get the time offset")
{
Nz::Audio::Instance()->SetGlobalVolume(0.f);
Nz::Audio::Instance()->GetDefaultDevice()->SetGlobalVolume(0.f);
sound.Play();
std::this_thread::sleep_for(std::chrono::seconds(1));
@@ -39,7 +39,7 @@ SCENARIO("Sound", "[AUDIO][SOUND]")
sound.SetPlayingOffset(3500);
REQUIRE(sound.GetPlayingOffset() >= 3500);
Nz::Audio::Instance()->SetGlobalVolume(100.f);
Nz::Audio::Instance()->GetDefaultDevice()->SetGlobalVolume(100.f);
}
}
}