diff options
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..c58b6b5 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>(appController); 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) { |