diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-12 22:16:12 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-12 22:16:12 +1000 |
commit | 40223a5090bf8a502094927da39fc96a5cfd5eae (patch) | |
tree | 01fc797ad3f45879d132de3063fe1cab3f554835 /source/client/StarClientApplication.cpp | |
parent | cf09616b1b241635dae0648c544b4e8ff3e2bd72 (diff) |
Initial work
Diffstat (limited to 'source/client/StarClientApplication.cpp')
-rw-r--r-- | source/client/StarClientApplication.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp index 356421b..e2a1515 100644 --- a/source/client/StarClientApplication.cpp +++ b/source/client/StarClientApplication.cpp @@ -14,6 +14,9 @@ #include "StarWorldTemplate.hpp" #include "StarWorldClient.hpp" #include "StarRootLoader.hpp" +#include "StarInput.hpp" +#include "StarVoice.hpp" + #include "StarInterfaceLuaBindings.hpp" #include "StarInputLuaBindings.hpp" @@ -171,6 +174,7 @@ void ClientApplication::applicationInit(ApplicationControllerPtr appController) m_guiContext = make_shared<GuiContext>(m_mainMixer->mixer(), appController); m_input = make_shared<Input>(); + m_voice = make_shared<Voice>(); auto configuration = m_root->configuration(); bool vsync = configuration->get("vsync").toBool(); @@ -417,8 +421,12 @@ void ClientApplication::render() { } void ClientApplication::getAudioData(int16_t* sampleData, size_t frameCount) { - if (m_mainMixer) - m_mainMixer->read(sampleData, frameCount); + if (m_mainMixer) { + m_mainMixer->read(sampleData, frameCount, [&](int16_t* buffer, size_t frames, unsigned channels) { + if (m_voice) + m_voice->mix(buffer, frames, channels); + }); + } } void ClientApplication::changeState(MainAppState newState) { |