From c7c7004ad5ad966f401fd385503526950acb762d Mon Sep 17 00:00:00 2001 From: taiqzheng <2013898008@qq.com> Date: Wed, 14 Aug 2024 06:17:47 +0000 Subject: [PATCH] [Audio Container] Resolve code review problems. --- frontend/Interfaces/buddy/DAP/AudioContainer.h | 6 +++--- tests/Interface/core/AudioContainerTest.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/Interfaces/buddy/DAP/AudioContainer.h b/frontend/Interfaces/buddy/DAP/AudioContainer.h index 0487463a0..649fac85a 100644 --- a/frontend/Interfaces/buddy/DAP/AudioContainer.h +++ b/frontend/Interfaces/buddy/DAP/AudioContainer.h @@ -183,9 +183,9 @@ bool Audio::saveToFile(std::string filePath, std::string format) { if (format == "wav" || format == "wave") { bool success = EncodeWaveFile(fileData); if (!success) { - this->audioFormat = AudioFormat::ERROR; - throw std::runtime_error("Failed to encode WAVE file."); - }; + std::cerr << "Failed to encode WAVE file." << std::endl; + return false; + } } else { std::cerr << "Unsupported: The encoding method for " << format << " format is not yet supported." << std::endl; diff --git a/tests/Interface/core/AudioContainerTest.cpp b/tests/Interface/core/AudioContainerTest.cpp index 3f45713e0..684584c3a 100644 --- a/tests/Interface/core/AudioContainerTest.cpp +++ b/tests/Interface/core/AudioContainerTest.cpp @@ -31,7 +31,7 @@ int main() { // 1. Print Decoded Reuslts using Buddy Audio Container // --------------------------------------------------------------------------- - // Read and decode audio file with Buddy Audio Contaier. + // Read and decode audio file with Buddy Audio Container. dap::Audio aud("../../../../tests/Interface/core/TestAudio.wav"); // CHECK: WAV