Commit c4e85662 authored by Muyuan Li's avatar Muyuan Li Committed by Commit Bot

assistant: add hack to increase TTS volume

Bug: b/111601093
Test: Manual
Change-Id: I8843c9fc0654cc0db5a6209bd32bda418992bd34
Reviewed-on: https://chromium-review.googlesource.com/1161336Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Muyuan Li <muyuanli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580368}
parent fd2e773f
...@@ -57,6 +57,9 @@ AssistantManagerServiceImpl::AssistantManagerServiceImpl( ...@@ -57,6 +57,9 @@ AssistantManagerServiceImpl::AssistantManagerServiceImpl(
background_thread_("background thread"), background_thread_("background thread"),
weak_factory_(this) { weak_factory_(this) {
background_thread_.Start(); background_thread_.Start();
background_thread_.task_runner()->PostTask(
FROM_HERE, base::BindOnce(&AssistantManagerServiceImpl::SetVolumeHack,
base::Unretained(this)));
connector->BindInterface(ash::mojom::kServiceName, connector->BindInterface(ash::mojom::kServiceName,
&voice_interaction_controller_); &voice_interaction_controller_);
...@@ -759,5 +762,10 @@ void AssistantManagerServiceImpl::SendContextQueryAndRunCallback( ...@@ -759,5 +762,10 @@ void AssistantManagerServiceImpl::SendContextQueryAndRunCallback(
std::move(callback).Run(); std::move(callback).Run();
} }
void AssistantManagerServiceImpl::SetVolumeHack() {
DCHECK(background_thread_.task_runner()->BelongsToCurrentThread());
platform_api_.GetFileProvider().WriteFile("assistant/volume/system", "1.0");
}
} // namespace assistant } // namespace assistant
} // namespace chromeos } // namespace chromeos
...@@ -193,6 +193,10 @@ class AssistantManagerServiceImpl ...@@ -193,6 +193,10 @@ class AssistantManagerServiceImpl
void OnAssistantScreenshotReceived(base::OnceClosure on_done, void OnAssistantScreenshotReceived(base::OnceClosure on_done,
const std::vector<uint8_t>& jpg_image); const std::vector<uint8_t>& jpg_image);
// Writes a file to assistant's path to force assistant volume to 100%.
// TODO(muyuanli): Remove once AudioOutputImpl is checked in.
void SetVolumeHack();
State state_ = State::STOPPED; State state_ = State::STOPPED;
PlatformApiImpl platform_api_; PlatformApiImpl platform_api_;
bool enable_hotword_; bool enable_hotword_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment