// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "Types.h" #if COMPILE_WITH_ASSETS_IMPORTER #include "Engine/Tools/AudioTool/AudioTool.h" #include "Engine/Tools/AudioTool/AudioDecoder.h" /// /// Enable/disable caching audio import options /// #define IMPORT_AUDIO_CACHE_OPTIONS 1 /// /// Importing audio utility /// class ImportAudio { public: typedef AudioTool::Options Options; public: /// /// Tries the get audio import options from the target location asset. /// /// The asset path. /// The options. /// True if success, otherwise false. static bool TryGetImportOptions(const StringView& path, Options& options); /// /// Imports the audio data (with given audio decoder). /// /// The importing context. /// The audio decoder. /// Result. static CreateAssetResult Import(CreateAssetContext& context, AudioDecoder& decoder); /// /// Imports the .wav audio file. /// /// The importing context. /// Result. static CreateAssetResult ImportWav(CreateAssetContext& context); /// /// Imports the .mp3 audio file. /// /// The importing context. /// Result. static CreateAssetResult ImportMp3(CreateAssetContext& context); #if COMPILE_WITH_OGG_VORBIS /// /// Imports the .ogg audio file. /// /// The importing context. /// Result. static CreateAssetResult ImportOgg(CreateAssetContext& context); #endif }; #endif