From 38a9bd0bc917866f77bcce758d9b1776b2dcfb31 Mon Sep 17 00:00:00 2001 From: "michal.szwaj" Date: Sun, 11 Mar 2018 15:27:47 +0100 Subject: [PATCH] Use audio channels configuration --- src/autoapp/Projection/ServiceFactory.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/autoapp/Projection/ServiceFactory.cpp b/src/autoapp/Projection/ServiceFactory.cpp index 410263c..ade1e38 100644 --- a/src/autoapp/Projection/ServiceFactory.cpp +++ b/src/autoapp/Projection/ServiceFactory.cpp @@ -62,11 +62,17 @@ ServiceList ServiceFactory::create(aasdk::messenger::IMessenger::Pointer messeng IAudioInput::Pointer audioInput(new AudioInput(1, 16, 16000), std::bind(&QObject::deleteLater, std::placeholders::_1)); serviceList.emplace_back(std::make_shared(ioService_, messenger, std::move(audioInput))); - IAudioOutput::Pointer mediaAudioOutput(new AudioOutput(2, 16, 48000), std::bind(&QObject::deleteLater, std::placeholders::_1)); - serviceList.emplace_back(std::make_shared(ioService_, messenger, std::move(mediaAudioOutput))); + if(configuration_->musicAudioChannelEnabled()) + { + IAudioOutput::Pointer mediaAudioOutput(new AudioOutput(2, 16, 48000), std::bind(&QObject::deleteLater, std::placeholders::_1)); + serviceList.emplace_back(std::make_shared(ioService_, messenger, std::move(mediaAudioOutput))); + } - IAudioOutput::Pointer speechAudioOutput(new AudioOutput(1, 16, 16000), std::bind(&QObject::deleteLater, std::placeholders::_1)); - serviceList.emplace_back(std::make_shared(ioService_, messenger, std::move(speechAudioOutput))); + if(configuration_->speechAudioChannelEnabled()) + { + IAudioOutput::Pointer speechAudioOutput(new AudioOutput(1, 16, 16000), std::bind(&QObject::deleteLater, std::placeholders::_1)); + serviceList.emplace_back(std::make_shared(ioService_, messenger, std::move(speechAudioOutput))); + } IAudioOutput::Pointer systemAudioOutput(new AudioOutput(1, 16, 16000), std::bind(&QObject::deleteLater, std::placeholders::_1)); serviceList.emplace_back(std::make_shared(ioService_, messenger, std::move(systemAudioOutput)));