/**
 * Copyright 2022-2025 Theai, Inc. dba Inworld AI
 */

#pragma once

#include "Graph/InworldData.h"
#include "HAL/IConsoleManager.h"
#include "Misc/Paths.h"

#if WITH_EDITOR && !UE_BUILD_SHIPPING
namespace inworld
{
namespace audio
{
namespace debug
{

/**
 * @brief Retrieves the console variable controlling debug audio dumping.
 *
 * This function returns a reference to the console variable that enables or
 * disables audio dumping for debugging purposes. When enabled, audio data
 * can be saved to files for analysis and troubleshooting.
 *
 * @return Reference to the debug dump console variable
 */
INWORLDRUNTIME_API const TAutoConsoleVariable<bool>& GetCVarDebugDump();

/**
 * @brief Retrieves the console variable specifying the debug dump file path.
 *
 * This function returns a reference to the console variable that defines
 * the directory path where debug audio files will be saved when audio
 * dumping is enabled.
 *
 * @return Reference to the debug dump path console variable
 */
INWORLDRUNTIME_API const TAutoConsoleVariable<FString>& GetCVarDebugDumpPath();

/**
 * @brief Dumps audio data to a file for debugging and analysis.
 *
 * This function saves the provided audio data to a file with the specified
 * filename, allowing developers to analyze captured or processed audio
 * for troubleshooting and optimization purposes.
 *
 * @param OutFileName The filename (without path) for the output audio file
 * @param Audio The audio data to save to the debug file
 */
INWORLDRUNTIME_API void DumpAudio(const FString& OutFileName, const FInworldData_Audio& Audio);

}	 // namespace debug
}	 // namespace audio
}	 // namespace inworld

#endif
